wood burning stoves*
The moose likes Java in General and the fly likes Simple Date/Time format question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Simple Date/Time format question" Watch "Simple Date/Time format question" New topic
Author

Simple Date/Time format question

Chintan B Shah
Ranch Hand

Joined: Sep 23, 2008
Posts: 83
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.


SCJA 1.0
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4338
    
    7

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

Joined: Sep 23, 2008
Posts: 83
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Date/Time format question
 
Similar Threads
xml date conversion all date conversions
how to set 2011-11-06T14:34:16.679+02:00 into XMLGregorianCalendar
Issues with fetching Year and Month from the Calender
Handling a strange date format
DateFormat, Calendar, and timezone - parsing a String into a Calendar