M
Maitland
I have a class which contains a Date object and I always want it to
output/format it's dates to reflect UTC time (GMT-0). The only way I
have found to be able to do this is to set the TimeZone.setDefault() to
the timezone I want right before I output or format the date. This
doesn't seem very intuitive, when I set the "default" timezone what
exactly am I setting? If I set it in the constructor of the object it
doesn't seem to apply when I output the date in some of that objects
methods. Is the scope of the default timezone limited to the current
local context?
output/format it's dates to reflect UTC time (GMT-0). The only way I
have found to be able to do this is to set the TimeZone.setDefault() to
the timezone I want right before I output or format the date. This
doesn't seem very intuitive, when I set the "default" timezone what
exactly am I setting? If I set it in the constructor of the object it
doesn't seem to apply when I output the date in some of that objects
methods. Is the scope of the default timezone limited to the current
local context?