Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Code That Converts Date Format into Julian Date Format

 
Veerendranag Banka
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10422
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Steve Fahlbusch
Bartender
Posts: 605
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2965
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also want to look at JodaTime which has support for the Julian calendar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic