Advertisement

07.15.2004 at 07:02PM PDT, ID: 21060719
[x]
Attachment Details

Convert Date Format

Asked by Bohumil in Java Programming Language

Tags: date, format, convert

What is the simplest way to convert a date string in a given format to another format?
I can see how I can format todays date in any given way via the java.text.SimpleDateFormat class but how do I get a specific date into this class when this date is formatted in a terribly non-standard way?

Here is the string that I get from an application:

Mon Sep 15 03:15:07 PDT 2003

What I need to convert it into is:

9/15/2003

Obviously I can pick the String apart via my own code but I'm wondering if that isn't exactly what all these date format classes were made for?

ThanksStart Free Trial
[+][-]07.15.2004 at 07:06PM PDT, ID: 11565120

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.15.2004 at 09:08PM PDT, ID: 11565585

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Tags: date, format, convert
Sign Up Now!
Solution Provided By: x4u
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.16.2004 at 09:42AM PDT, ID: 11569969

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2004 at 03:33PM PDT, ID: 11579610

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32