Hi all,

I was wondering if any of you could tell me how to convert a date format that is being returned in my XML.

The element content is being returned as a string of form

"2010-11-16T09:00:00Z".

The XML is a copy of some metadata of an object in my database. The database stores the date of he form "11/16/2010 11:00:00"

Is there away of converting the string from my XML back to a moer typical date format (Ignoring the substring remove T, Z type approach)?


many thanks

RB

Use the SimpleDateFormat class - create an instance using a pattern that describes your date's format, then use the parse method to convert your String to a java Date object. Once you have a Date object you can use another SimpleDateFormat to convert that to pretty much any format you want.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.