> Hello,
>
[quoted text clipped - 8 lines]
>
> T.Ramos
It's default uses the time zone of your machine....Try out some of this
code, and maybe it will help you with what you are looking for...
Calendar cal = Calendar.getInstance();
System.out.println(cal.getTimeZone());
//List of Ids, you'll need these to set the timezone.
for (String id : TimeZone.getAvailableIDs()) {
System.out.println(id);
}
TimeZone parisZone = TimeZone.getTimeZone("Europe/Paris");
DateFormat def =
DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG,
Locale.FRANCE);
def.setTimeZone(parisZone);
Calendar cal2 = Calendar.getInstance(parisZone);
System.out.println(cal2.get(Calendar.HOUR));
System.out.println(def.format(cal2.getTime()));
System.out.println(cal2.getTimeZone());
System.out.println(cal2.getTime()); //Careful toString() of
java.util.Date does things different
terloon - 12 Jul 2006 18:46 GMT
> It's default uses the time zone of your machine....Try out some of this
> code, and maybe it will help you with what you are looking for...
So does this mean that it doesn't matter how I set the TimeZone via
TimeZone.setDefault() or the setTimeZone method of the
GregorianCalendar object, it will always use the TimeZone of my
machine?
Danno - 12 Jul 2006 19:08 GMT
> > It's default uses the time zone of your machine....Try out some of this
> > code, and maybe it will help you with what you are looking for...
[quoted text clipped - 3 lines]
> GregorianCalendar object, it will always use the TimeZone of my
> machine?
Check out the code, you can set the timezone of a Calendar object and
it works.
terloon - 12 Jul 2006 19:20 GMT
> > > It's default uses the time zone of your machine....Try out some of this
> > > code, and maybe it will help you with what you are looking for...
[quoted text clipped - 6 lines]
> Check out the code, you can set the timezone of a Calendar object and
> it works.
Oh bother, it does work. I had a setTimeZone hidden away setting it
back to GMT unbeknownst to me. Chalk this one up to carelessness.
Danno - 12 Jul 2006 20:03 GMT
> > > > It's default uses the time zone of your machine....Try out some of this
> > > > code, and maybe it will help you with what you are looking for...
[quoted text clipped - 9 lines]
> Oh bother, it does work. I had a setTimeZone hidden away setting it
> back to GMT unbeknownst to me. Chalk this one up to carelessness.
;) Happens to all of us.