This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Calendar 1st day of week changes? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Calendar 1st day of week changes?" Watch "Calendar 1st day of week changes?" New topic
Author

Calendar 1st day of week changes?

Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
Anyone want to guess why the first day of the week is changing on me?


[ June 28, 2005: Message edited by: Roger Graff ]
Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
Here's the output:

Sunday, 03/27/2005 is the 1st day of the week!
Monday, 03/28/2005 is the 2nd day of the week!

Sunday, 04/03/2005 is the 1st day of the week!
Monday, 04/04/2005 is the 1st day of the week!

Sunday, 04/10/2005 is the 7th day of the week!
Monday, 04/11/2005 is the 1st day of the week!

Press any key to continue . . .
Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
Hmmm. I made the following changes and it seems to be working. Shame on me for not using the interface in the first place!

TimeZone timeZone = TimeZone.getTimeZone( "GMT-5" );
Locale locale = Locale.US;
GregorianCalendar calendar = new GregorianCalendar( timeZone, locale );

to

Calendar calendar = Calendar.getInstance();
Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
Okay - here's the culprit:

TimeZone timeZone = TimeZone.getTimeZone( "GMT-5" );
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Calendar 1st day of week changes?
 
Similar Threads
Any Alternative for this CODE !!!!!!
convert a string to java.sql.Date object
Date Format Issue
convert date to dd-mm-yyyy pattern
Formatting date as MMM for japnese locale