How to get current date..now()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2017 05:25 AM
Hi friends.
I want to capture the current date to one of my field.
We can capture the time from nowDateTime() function.
But i want to capture directly In 28-Nov-2016 format.
can we use function : now()
But it says 'Gets the current date using GMT date time.' .
My question is will it capture current date? as its mentioned GMT...will it capture different date.....
if yes then in what format it will capture..
I am not able to produce/create scenario here to test...
Please advice
Thank you very much in advance.
regards
Aarav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2017 06:09 AM
Hi Aarav,
You can use .getDisplayValue(); for capturing current date of your time zone.
For instance, to get current date of opened field you can use
var abc=current.opened.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2017 06:14 AM
Also, you can use setDisplayValue to set the time to now:
current.opened.setDisplayValue(gs.nowDateTime());

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 01:54 AM
Hi Jaspal,
In Rest Api am trying to query using sys_created_onONgs.nowDateTime()
This returns in GMT.
Is it possible to get result user's timezone ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 03:24 AM
hi you can try gs.getSession().getTimeZoneName();
also read How to I get the user's current Timezone settings via api calls / scripting?