Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple Date/Time format question

 
Chintan B Shah
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Have lost touch of writing core Java code for a while now..so please bear with me.

I have a date/timestring which needs to be converted to XMLGregorianCalendar.

Following is code I am using



The output as I am viewing on web-page is coming out to "04/30/2011 1:22 AM".

What am I doing wrong? Any help is appreciated.

Thanks
Chintan.
 
Matthew Brown
Bartender
Posts: 4565
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that's the right code? Where is today defined? And since you've created two Calendars there with different dates, which one are you outputting?
 
Chintan B Shah
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Matthew,
sorry my bad.
Its actually

And since you've created two Calendars there with different dates, which one are you outputting?

I am outputting "calendar".

sorry for being not clear.

Thanks
Chintan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic