• bglkarthik
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi experts,

If I issue the following command in an apex class ...

Code:
    DateTime d = System.now();
    return d;

...the datetime it returns belongs to which time zone?

It returned me "Thu May 01 07:40:07 GMT 2008" when I tested on Thursday 05/01/2008 at 1:25PM. Which is correct according to my timezone location.
(my time zone location is "(GMT+05:45) Kathmandu")

Does it always return GMT time? Or it depends on some settings? If so, what is the place of the setting? How do I access that via code?

Also, is there any method like one in javascript "getTimezoneOffset()"?

According to JavaScript guide:
The getTimezoneOffset() method returns the number of minutes that the current time zone is ahead or behind UTC. For  instance, getTimezoneOffset() returns 300 for U.S. Eastern Daylight Saving Time, which is 5 hours (or 300 minutes) behind UTC.

Thanks,
-Roshan