• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTimestamp problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSTimestamp problem
      • From: Lachlan Deck <email@hidden>
    • Re: NSTimestamp problem
      • From: Simon McLean <email@hidden>
  • Prev by Date: To Many to EOs w/ Compound Primary Keys that Include Reverse Foreign Key (+INHERITANCE!!!) -- FIX / WORK-AROUND
  • Next by Date: Re: NSTimestamp problem
  • Previous by thread: Re: ReportMill can't find Framework?
  • Next by thread: Re: NSTimestamp problem
  • Index(es):
    • Date
    • Thread