comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Julian Dates...Again
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Julian Dates...Again [message #53761] Tue, 01 May 2007 11:35 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 01 May 2007 10:31:00 -0700, David Fanning wrote:

> Folks,
>
> OK, I don't have time for this today... :-(
>
> Suppose I have a time string: "2007118".
> The first four digits are the year. The last
> three digits are the day of the year. (e.g.,
> Jan 10, 2007 is 010 and Feb 1, 2007 is 032, etc.)
>
> I can't seem to put my hands on a function that will
> convert the day of the year to a month and day value,
> so that I can create a Julian number with JULDAY.
> (Although I can imagine I have written such a thing in
> the past. All I have to do is find that damn formula
> for leap year processing and...)
>
> Does anyone have one of these do-hickeys available?

If you worry that Kuyper's trick goes against the documented input
requirements and so could be broken by future updates, just ask for
the Julian date of Jan 1st, then add 117 days:

IDL> print,julday(1,1,2007)+(118-1)

This doesn't validate your input time string (e.g. 2004366 is valid,
2000366 is not), but it will get the correct answer either way.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Julian Dates...Again
Next Topic: Antarctic Temperature Data

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:34:25 PDT 2025

Total time taken to generate the page: 0.00385 seconds