You need to sign in to do that
Don't have an account?
sfadm sfadm
DateTime set to an hour earlier
I have an object of type Time startWorkingTime and object of type DateTime nextBusinessDay. I want to create new object of type DateTime based on startWorkingTime and nextBusinessDay.
Here is my code:
For example:
Here is my code:
DateTime startWorkingTime = DateTime.newInstance(nextBusinessDay.year(), nextBusinessDay.month(), nextBusinessDay.day(), currentStartHours.hour(), currentStartHours.minute(), currentStartHours.second());After startworkingtime the time is set one hour earlier
For example:
23:59:24:025 USER_DEBUG [188]|DEBUG|currentStartHours 09:00:00.000Z 23:59:24:025 USER_DEBUG [189]|DEBUG|currentStartHours.hour() 9 23:59:24:025 USER_DEBUG [197]|DEBUG|startWorkingTime 2017-08-04 08:00:00Could you please explain why the hour in startWorkingTime is 08:00:00 and advise how to fix it?
I had to use newInstanceGmt isntead.