September 17th, 2002, 04:33 AM
I need the correct syntax of a java function that returns the name of the day of the given date.
Can anybody help me?
September 17th, 2002, 07:29 AM
September 17th, 2002, 07:42 AM
Google is my friend too... Still, I need a working example; I'm fed up with the trial & error method. I don't have enough time for that.
I need something like this:
What the .. is the correct syntax?
Thanks in advance,
September 17th, 2002, 01:29 PM
String tuesday = new java.text.SimpleDateFormat( "E").format( new java.util.Date().parse( "9-17-2002" ) );
September 17th, 2002, 03:32 PM
Bloody hell this thing was annoying. Here ya go.
Date day = ((DateFormat)new java.text.SimpleDateFormat( "MM-dd-yyyy" )).parse( "09-19-2002" );
String day_name = new java.text.SimpleDateFormat( "EEEEEEEEE" ).format( day );
September 19th, 2002, 04:40 AM
I'll check out the code right away!
By the way, what did you mean with "Bloody hell this thing was annoying"; the time it took to find the code?
September 19th, 2002, 11:31 AM
Ya. SimpleDateFormat extends a class with a parse method that takes a long as a parameter instead of a Date. It took me awhile to track down why I was getting "java.text.SimpleDateFormat.parse( java.util.Date ) not found. long expected" or whatever the error was
It looked like such a simple thing at first...
September 23rd, 2002, 06:54 AM
I understand what you mean; these are the minor irritations during software development. Happily, there are even more goodies to compensate this feeling.. ;-)