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

Home » Public Forums » archive » Re: Day of Year... Too lazy for a two-line solution...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Day of Year... Too lazy for a two-line solution... [message #62104] Fri, 22 August 2008 12:43
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ed Hyer writes:

> I handle all date manipulation in my routines using JULDAY(), CALDAT,
> and the C() format code. Going from Day-of-Year to Julian Date is
> easy:
>
> Julian_Date = JULDAY(1,Day_Of_Year,Year,0,0,0)
>
> Getting Day-of-Year back out requires this, *unless you can do
> better*:
>
> CALDAT,Julian_Date,Null,Null,Year
> Day_Of_Year = Julian_Date - JULDAY(12,31,Year-1,0,0,0)
>
> I would really like a one-line solution with no stray variables.
> Anyone have one?

Would a call to a three-line function qualify as an answer?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Day of Year... Too lazy for a two-line solution...
Next Topic: help automating 'read in process' and general automating help

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

Current Time: Fri Oct 10 22:17:53 PDT 2025

Total time taken to generate the page: 0.71478 seconds