You need to sign in to do that
Don't have an account?
WPCMS
NOW() Showing Wrong Time
I am currently in the Eastern time zone of the United States.
My current time is 9:50 a.m.
When I use the NOW() funtion it shows the correct date but not the correct time. It shows 13:50 (1:50 p.m.).
I checked the Company default Time Zone and it says
(GMT-4:00) Easter Daylight Time (America/New_York).
Why is it off?
Thank you in advnace.
Having had the same issue this morning , i found a simple solution to use NOW() function and get proper time according to time zone
I'm EST and there is a +4h difference with GMT
Using formula NOW() -4 would take out 4 days and not 4 hours , so what i did is:
1 day/24h = 0.0416666666 (value of 1 hour)
0.041666666(value of 1 hour) x 4 (how many hours difference my timezone to GMT) = 0.166666664
then I used (NOW () - 0.166666664) and that gave me current time
hope it helps
Dave
All Answers
Have you checked YOUR timezone?
Name->Setup->My Personal Information->Personal Information
Time Zone
Regards
I am showing the same as the company organization, GMT -4:00.
Now it is 4 hours a head!
Current time: 12:20
NOW Time:
This is probably not immensely helpful to solving your issue, but I just did a quick google search (which I'm sure you've already done), and found this post on Stack Overflow. Maybe it's somewhat helpful, if you haven't seen it yet.
I'm very interested to know if you ever get a working solution.
Try, System.Now()
If you are using the NOW() function in a formula field, the timezone conversion will NOT be performed and the date calculation will be off by the number of hours you are shifted away from GMT.
What I am doing in my formula is the following:
It is the date then current time then initials of user
Example output
201205031556ABC
Date is 20120503
Time 1556 (which is wrong it should be 1156)
Initials ABC
Any other ideas on how to handle this formula?
Having had the same issue this morning , i found a simple solution to use NOW() function and get proper time according to time zone
I'm EST and there is a +4h difference with GMT
Using formula NOW() -4 would take out 4 days and not 4 hours , so what i did is:
1 day/24h = 0.0416666666 (value of 1 hour)
0.041666666(value of 1 hour) x 4 (how many hours difference my timezone to GMT) = 0.166666664
then I used (NOW () - 0.166666664) and that gave me current time
hope it helps
Dave
You are welcome , glad it could help someone else :)
Returns the current Datetime based on a GMT calendar. So, system.now() and Datetime.now() returns Datetime based on a GMT calendar.
now().format()
Returns the current Datetime based on the user timezone settings in the user detail.
Sample code:
system.debug('System DateTime is ' + DateTime.now());
system.debug('System DateTime is ' + System.now());
system.debug('User DateTime is ' + DateTime.now().format());
system.debug('User DateTime is ' + System.now().format());