Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Calendar 1st day of week changes?

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay - here's the culprit:

TimeZone timeZone = TimeZone.getTimeZone( "GMT-5" );
 
reply
    Bookmark Topic Watch Topic
  • New Topic