Results 1 to 1 of 1
Thread: Timezone in java
- 05-28-2009, 01:12 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 3
- Rep Power
- 0
Timezone in java
Hi All,
For the following code, i am passing long value to Date and then applying TimeZone formate for that same date, finally converting that to long again..
so the long value before and after applying timezone is different.
I have a query here.. After applying TimeZone format to date, how this long values differ? can you please explain me ?
long offerdate= 1243362600000L;
System.out.println("Long value before formating date :- "+offerdate);
Date date = new Date(offerdate);
System.out.println("before :"+date);
TimeZone timezone = TimeZone.getTimeZone("EST5EDT");
DateFormat dataformat = DateFormat.getDateInstance();
dataformat.setTimeZone(timezone);
String dateAftersettingZone = dataformat.format(date);
date = (Date)dataformat.parse(dateAftersettingZone);
System.out.println("After :"+date);
long val = date.getTime();
Thanks,
Deepa
Similar Threads
-
Regarding olson timezone database
By navneet.tech2009@gmail.co in forum New To JavaReplies: 0Last Post: 09-23-2008, 12:47 PM -
How to use TimeZone class of java
By Java Tip in forum java.utilReplies: 0Last Post: 04-06-2008, 07:39 PM -
How to accurately test if timezone data is updated?
By Santhosh in forum Advanced JavaReplies: 0Last Post: 11-14-2007, 06:53 AM -
Is there any utility that reads TimeZone data and display it in Human readable format
By Santhosh in forum Advanced JavaReplies: 0Last Post: 11-06-2007, 02:20 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks