This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Java in General and the fly likes converting date string into Calendar.Day of Year Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "converting date string into Calendar.Day of Year" Watch "converting date string into Calendar.Day of Year" New topic
Author

converting date string into Calendar.Day of Year

Kevin Brewer
Greenhorn

Joined: Oct 04, 2003
Posts: 3
does anybody know how to convert a date string into Calendar Day of Year
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62138
    
  68

Moving to Java in General (Intermediate)
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Greg Reinl
Ranch Hand

Joined: Feb 11, 2003
Posts: 45
This method is one way to do it. It converts a String in MM/dd/yyyy to the int vlaue of the day of the year.

To make vary this approach to fit your needs, see the API doco on SimpleDateFormat.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: converting date string into Calendar.Day of Year