NSTimestamp problem
NSTimestamp problem
- Subject: NSTimestamp problem
- From: Gino Pacitti <email@hidden>
- Date: Sun, 15 Jun 2008 12:55:04 +0100
Does anyone have a link to solution to hour of day being incorrect?
NSTimeZone tz = NSTimeZone.timeZoneWithName("Europe/London",
true);
java.util.GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(new NSTimestamp());
int year = calendar.get(GregorianCalendar.YEAR);
int dayOfMonth = calendar.get(GregorianCalendar.DAY_OF_MONTH);
int month = calendar.get(GregorianCalendar.MONTH);
int hour = calendar.get(GregorianCalendar.HOUR_OF_DAY);
int minute = calendar.get(GregorianCalendar.MINUTE);
int second = calendar.get(GregorianCalendar.SECOND);
NSTimestamp correctedDate = new NSTimestamp(year, ++month,
dayOfMonth, hour, minute, second, tz);
Current time
2008-06-15 12:51:15 Etc/GMT
System.out.println("Time Stamp Date" + correctedDate);
Time reported
2008-06-15 11:51:15 Etc/GMT
Why do I loose the hour?
WO 5.3.* OSX 10.4.11 Java 1.5
Any help appreciated..
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden