function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion


Can anyone tellme why this below changes happening. If i create a datetime instance with date 2016-06-16 and time 12:00 then the debug shows different datetime like i have mentioned below. Thanks in advance.

Datetime dTime1 = Datetime.newInstance(2016, 06, 16, 12, 00, 00);   2016-06-16 12:00:00
Datetime dTime2 = Datetime.newInstance(2016, 06, 16, 1, 00, 00);     2016-06-16 01:00:00
system.debug('dTime1  '+dTime1);
system.debug('dTime2  '+dTime2);

|DEBUG| dTime1 -->  2016-06-16 06:30:00
|DEBUG| dTime2 -->  2016-06-15 19:30:00
JyothsnaJyothsna (Salesforce Developers) 
Hi Saroo,

Please check your org Time zone. 
goto your name----> My settings--->personal--->Language & Time Zone.

Let me know if it solves your problem.

Best Regards,

Shailendra Singh ParmarShailendra Singh Parmar
I think, this is because System.debug show datetime in GMT while your inputs are in your own timezone that you have on your user profile.