Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old September 17th, 2002, 03:33 AM
EHendriks EHendriks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Amersfoort, The Netherlands
Posts: 10 EHendriks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 sec
Reputation Power: 0
Day name

I need the correct syntax of a java function that returns the name of the day of the given date.


Can anybody help me?

Erwin

Reply With Quote
  #2  
Old September 17th, 2002, 06:29 AM
kittykiller's Avatar
kittykiller kittykiller is offline
Golden Member =p
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Final Frontier
Posts: 9 kittykiller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0

Reply With Quote
  #3  
Old September 17th, 2002, 06:42 AM
EHendriks EHendriks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Amersfoort, The Netherlands
Posts: 10 EHendriks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 sec
Reputation Power: 0
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:

Calendar.get(Calendar.DAY_OF_WEEK)

What the .. is the correct syntax?

Thanks in advance,

Erwin

Reply With Quote
  #4  
Old September 17th, 2002, 12:29 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
String tuesday = new java.text.SimpleDateFormat( "E").format( new java.util.Date().parse( "9-17-2002" ) );

Reply With Quote
  #5  
Old September 17th, 2002, 02:32 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Bloody hell this thing was annoying. Here ya go.
Code:
Date day = ((DateFormat)new java.text.SimpleDateFormat( "MM-dd-yyyy" )).parse( "09-19-2002" );
String day_name = new java.text.SimpleDateFormat( "EEEEEEEEE" ).format( day );

Reply With Quote
  #6  
Old September 19th, 2002, 03:40 AM
EHendriks EHendriks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Amersfoort, The Netherlands
Posts: 10 EHendriks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 sec
Reputation Power: 0
I'll check out the code right away!

Erwin

By the way, what did you mean with "Bloody hell this thing was annoying"; the time it took to find the code?

Reply With Quote
  #7  
Old September 19th, 2002, 10:31 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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...

Reply With Quote
  #8  
Old September 23rd, 2002, 05:54 AM
EHendriks EHendriks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: Amersfoort, The Netherlands
Posts: 10 EHendriks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 sec
Reputation Power: 0
I understand what you mean; these are the minor irritations during software development. Happily, there are even more goodies to compensate this feeling.. ;-)


Erwin

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Day name


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway