scope of default TimeZone

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?
 
T

Thomas Weidenfeller

Maitland said:
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).

SimpleDateFormat. You might need to assemble a SimpleTimeZone first, and
use it to set the date format's time zone first.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top