• 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
Re: Bogus Gregorian Calendar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bogus Gregorian Calendar


  • Subject: Re: Bogus Gregorian Calendar
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 17 Jun 2004 18:53:16 -0700

The bug is that you did not read the docs.  :-)  GregorianCalendar numbers
months starting from zero.


Chuck

At 11:39 AM 18/06/2004 +1000, Greg Hulands wrote:
>Hi,
>I am getting the current date by doing:
>
>GregorianCalendar now = new GregorianCalendar();
>
>But the only thing is that it is not using the correct month.
>I logged it to the console and got this. The month is 5 not 6.
>
>java.util.GregorianCalendar[time=1087522528940,areFieldsSet=true,areAllF
>ieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Australia
>/
>Brisbane",offset=36000000,dstSavings=0,useDaylight=false,transitions=18,
>lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2004
>,MONTH=5,WEEK_OF_YEAR=25,WEEK_OF_MONTH=3,DAY_OF_MONTH=18,DAY_OF_YEAR=170
>,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=11,HOUR_OF_DAY=11,MIN
>UTE=35,SECOND=28,MILLISECOND=940,ZONE_OFFSET=36000000,DST_OFFSET=0]
>
>Yes the date in the computer is set correctly so it can't be the
>problem. Is there a bug in GregorianCalendar?
>
>Any info is appreciated.
>
>Greg
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
>

--

Chuck Hill                                 email@hidden
Global Village Consulting Inc.             http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: Inheritance from separate model file
  • Next by Date: Article on Java 1.4.2 vs C++ speed
  • Previous by thread: Re: Bogus Gregorian Calendar
  • Next by thread: Article on Java 1.4.2 vs C++ speed
  • Index(es):
    • Date
    • Thread