A friendly place for Java greenhorns!
Java
Ranch
»
JavaRanch Saloon
Search
|
FAQ
|
Recent Topics
|
Hot Topics
Register
/
Login
Java
Ranch
»
Forums
»
Java
»
Java in General
Author
Problem with converting TimeZone as PST
Naresh Talluri
Ranch Hand
Joined: Oct 12, 2007
Messages: 99
posted
Jul 01, 2009 11:19:01
Dear All,
I have problem with converting
TimeZone
in PST,
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,
Thanks,
Jason Irwin
Ranch Hand
Joined: Jun 09, 2009
Messages: 304
posted
Jul 05, 2009 10:07:53
Err....you may want to read the API docs.....
Calendar.getTimeInMillis()
SCJP6
Java
Ranch
»
Forums
»
Java
»
Java in General
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter