aspose file tools*
The moose likes Java in General and the fly likes Java Code That Converts Date Format into Julian Date Format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Code That Converts Date Format into Julian Date Format" Watch "Java Code That Converts Date Format into Julian Date Format" New topic
Author

Java Code That Converts Date Format into Julian Date Format

Veerendranag Banka
Greenhorn

Joined: Nov 30, 2012
Posts: 17
Hai All,
I Have A Requirement That Converts the Given Date in 'yyMMdd' Format into Julain Date 'ddd' Format Any Help Is Appreciated.
Regards,
Veerendranag.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7081
    
  16

Veerendranag Banka wrote:I Have A Requirement That Converts the Given Date in 'yyMMdd' Format into Julain Date 'ddd' Format Any Help Is Appreciated.

OK, so what have you tried?

I'm afraid we're not in the business of simply handing out answers here; but my advice would be to start by reading up on the SimpleDateFormat class.

Second piece of advice: Don't write a single line of Java code until you fully understand what you need to do.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
Steve Fahlbusch
Bartender

Joined: Sep 18, 2000
Posts: 557
    
    7

Actually what you want to do is to convert a Gregorian Date to a Year plus day of year.

A Julian Day is really a count of days from January 1 4713 BCE.

The Julian Day Number (JDN) is the integer assigned to a whole solar day in the Julian day count starting from noon Greenwich Mean Time, with Julian day number 0 assigned to the day starting at noon on January 1, 4713 BC proleptic Julian calendar. (November 24, 4714 BC in the proleptic Gregorian calendar.) For example, the Julian day number for 1 January 2000 was 2,451,545.
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 1950
    
  28
You may also want to look at JodaTime which has support for the Julian calendar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Code That Converts Date Format into Julian Date Format
 
Similar Threads
Help:java.lang.String and java.sql.Date
error- help
How to convert this String into a readable date?
validating Date field and saving into DB?
inserting date and time into database