Hi there,
I’ve spent a few minutes on the forum looking for a similar topic, but I found nothing.
Currently I’m using platform ver 6.10, as mentioned here in the manual:
https://doc.cuba-platform.com/manual-6.10/datatype_format_strings.html
If both fields are empty, no time zone conversions are performed for the user. Otherwise, the platform saves time zone in the UserSession object when the user logs in and uses it for displaying and entering timestamp values. The application code can also use the value returned by
UserSession.getTimeZone()
for custom functionality.
My server timezone is CST. I did select PDT for admin user.
Then injecting a DateField to controller:
@Inject
DateField fromDate;
System.out.println(userSessionSrc.getUserSession().getTimeZone());
System.out.println(fromDate.getTimeZone());
System.out.println(scheduleFrom);
What I expected is the Date object should be converted to PDT, but it was not.
Here is what it printed out:
sun.util.calendar.ZoneInfo[id=“US/Pacific-New”,offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=US/Pacific-New,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]_
null
Tue Jun 04 00:00:00 CDT 2019
Any suggestion would be appreciated.
Thanks