Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Problem with converting TimeZone as PST
Joined: Oct 12, 2007
Jul 01, 2009 11:19:01
I have problem with converting
here the problem is i can able to convert timezone, it is showing time properly, but while trying to get in milli secs iam getting different timezone
like EDT , GMT ...
here is my code
Date startTime = new Date(); TimeZone.setDefault ( TimeZone.getTimeZone ("PST")) ; Calendar c=Calendar.getInstance(); System.out.println("Date : "+c.getTime()); System.out.println("Time in mill's "+c.getTimeInMillis());
can you please let me know your thoughts,
Joined: Jun 09, 2009
Jul 05, 2009 10:07:53
Err....you may want to read the API docs.....
It is sorta covered in the
JavaRanch Style Guide
subject: Problem with converting TimeZone as PST
Problem in Changing Timezone (URGENT)
Problem in setting TimeZone to PST
Need to specify the time as GMT while creating the date, JVM is on EST
Time Zone problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013