Re: Java String to date format
From: JD Uhler (jduhler_at_hotmail.com)
Date: 31 Dec 2003 08:28:41 -0800
While we are on the topic of dates.. are there any methods/properties
that tell you which fiscal year you are currently in? I was going to
create the whole "greater/less than July 1st" routine, but thought
there may be an easier way.
John O'Conner <email@example.com> wrote in message news:<FykIb.firstname.lastname@example.org>...
> JD Uhler wrote:
> > I want to convert the String "2001-09-07 00:00:00.0" into the format
> > "09/07/2001". How do I do that without having to do a bunch of string
> > manipulations? Can I use SimpleDateFormat to just convert it to a
> > string? I have tried that, but an error comes back saying something
> > like "Cannot convert Object to Date".
> > The original String can be null as well.
> > Thank you
> > JD
> Another (easier/quicker) option is to use String's split() method to
> create an array containing the substrings "2001", "09", and "07". Now
> you can create a new String using these substrings. There are a few
> string manipulations, but they are simple.
> John O'Conner