Julian Date to Normal Date

  • Follow


I am having string as '033162513' which consist of julian date (first three characters i.e. 033) and time (rest 6 characters i.e. 162513). How can I convert julian date into normal date. Here 033 means 2 Feb. Is there any command in matlab to convert Julian date into Normal date?
0
Reply Rakesh 12/7/2010 9:25:07 AM

On 07/12/10 3:25 AM, Rakesh wrote:
> I am having string as '033162513' which consist of julian date (first
> three characters i.e. 033) and time (rest 6 characters i.e. 162513). How
> can I convert julian date into normal date. Here 033 means 2 Feb. Is
> there any command in matlab to convert Julian date into Normal date?

Break this up in to two parts. Separate out the time information and 
parse it in to a fraction of a day, either by doing the calculations 
yourself or by using date2num. Take the julian date string, convert it 
to a number, add the fraction which is the time. To the whole thing, add 
the serial date number of the beginning of the year. The result will be 
the serial date number of date/time in question, and can be converted 
back using datenum.


Alternately, get the date vector form of the beginning of the year. 
Break the various time components out of the string and convert them to 
number and write them in to the appropriate offset of the date vector. 
Take the julian date number part of the string and convert it to number 
and write it in as the day number of the month, leaving the month set at 
1. This will produce an odd looking date vector such as the "33rd of 
January", but when you use datenum to convert the funny date vector back 
to a string, it will automatically handle the situation and calculate 
the proper month and day of the month, including taking leap years in to 
account.
0
Reply Walter 12/7/2010 11:18:10 AM


"Rakesh " <errakeshjain@gmail.com> wrote in message <idkuhj$b5m$1@fred.mathworks.com>...
> I am having string as '033162513' which consist of julian date (first three characters i.e. 033) and time (rest 6 characters i.e. 162513). How can I convert julian date into normal date. Here 033 means 2 Feb. Is there any command in matlab to convert Julian date into Normal date?

(groan) That is *not* a Julian Date, it is a Day-Of-The-Year. About every 6 months or so something pops up either on this newsgroup or on the FEX claiming to work with a Julian Date when in fact it is a Day-Of-The-Year they are working with. The term Julian Date has a very specific definition and should be reserved for that use alone. e.g., quoting from here:

http://en.wikipedia.org/wiki/Julian_date

"The Julian date (JD) is the interval of time in days and fractions of a day since January 1, 4713 BC Greenwich noon."

I realize that there are many, many websites that incorrectly the term Julian Date to apply to Day-Of-The-Year, even some technical websites, but I still feel the need to correct the misuse when I encounter it.

James Tursa
0
Reply James 12/7/2010 4:17:05 PM

Walter Roberson <roberson@hushmail.com> wrote in message <SJoLo.54$AU3.34@newsfe04.iad>...
> On 07/12/10 3:25 AM, Rakesh wrote:
> > I am having string as '033162513' which consist of julian date (first
> > three characters i.e. 033) and time (rest 6 characters i.e. 162513). How
> > can I convert julian date into normal date. Here 033 means 2 Feb. Is
> > there any command in matlab to convert Julian date into Normal date?
> 
> Break this up in to two parts. Separate out the time information and 
> parse it in to a fraction of a day, either by doing the calculations 
> yourself or by using date2num. Take the julian date string, convert it 
> to a number, add the fraction which is the time. To the whole thing, add 
> the serial date number of the beginning of the year. The result will be 
> the serial date number of date/time in question, and can be converted 
> back using datenum.
> 
> 
> Alternately, get the date vector form of the beginning of the year. 
> Break the various time components out of the string and convert them to 
> number and write them in to the appropriate offset of the date vector. 
> Take the julian date number part of the string and convert it to number 
> and write it in as the day number of the month, leaving the month set at 
> 1. This will produce an odd looking date vector such as the "33rd of 
> January", but when you use datenum to convert the funny date vector back 
> to a string, it will automatically handle the situation and calculate 
> the proper month and day of the month, including taking leap years in to 
> account.
Thanks for your reply. I will work on this.
0
Reply Rakesh 12/7/2010 5:15:27 PM

"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <idlmm1$r0o$1@fred.mathworks.com>...
> "Rakesh " <errakeshjain@gmail.com> wrote in message <idkuhj$b5m$1@fred.mathworks.com>...
> > I am having string as '033162513' which consist of julian date (first three characters i.e. 033) and time (rest 6 characters i.e. 162513). How can I convert julian date into normal date. Here 033 means 2 Feb. Is there any command in matlab to convert Julian date into Normal date?
> 
> (groan) That is *not* a Julian Date, it is a Day-Of-The-Year. About every 6 months or so something pops up either on this newsgroup or on the FEX claiming to work with a Julian Date when in fact it is a Day-Of-The-Year they are working with. The term Julian Date has a very specific definition and should be reserved for that use alone. e.g., quoting from here:
> 
> http://en.wikipedia.org/wiki/Julian_date
> 
> "The Julian date (JD) is the interval of time in days and fractions of a day since January 1, 4713 BC Greenwich noon."
> 
> I realize that there are many, many websites that incorrectly the term Julian Date to apply to Day-Of-The-Year, even some technical websites, but I still feel the need to correct the misuse when I encounter it.
> 
> James Tursa

Dear James,
Thanks for correcting my mistake.
0
Reply Rakesh 12/7/2010 5:18:20 PM

4 Replies
771 Views

(page loaded in 0.055 seconds)

Similiar Articles:













7/24/2012 5:25:13 AM


Reply: