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

Home » Public Forums » archive » Re: Time convertion
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: Time convertion [message #24248 is a reply to message #24126] Tue, 20 March 2001 06:04 Go to previous message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
JD Smith wrote:

> Alex Schuster wrote:

>> I found such a thing in the Astro library, st2date, input is the
>> seconds-since-1970, output is year, month, day etc., and even day and
>> month in ASCII notation if one likes. Great. But I did not find
>> something yet to convert to seconds-since-1970. I could write it myself,
>> but I guess this already had be done some dozen times. Some big routine
>> with many, many keywords to convert between all those formats would be
>> nice :)
>
> Hmm... I doubt you found that in the Astro library, since I wrote it and
> posted it to the newsgroup back in 1998. I did use daycnv from the
> astro package to convert julian to calendar dates.

Umm, right. I found it in the folder where my copy of the Astro library
resides.

> The recent
> IDL-bundled "caldat" will work just as well for that now.

Hooray! I hope it also can output various time strings... but I'm still
using IDL 5.2 :(

> In any case,
> it is oh so trivial to convert date to systime, the inverse:
>
> st=(julday(month,day,year,hr,min,sec)-2440587.5D)*86400.0D

Okay, right. Once you know that these Julian Days are, and if you don't
think about leap seconds. I already did the same, but made the mistake
of using julday(1,1,1970) instead of julday(1,1,1970,0,0,0), which gives
half a day offset. Okay, my fault, but if IDL already had such a
conversion routine, I wouldn't have to think about it, and I wouldn't be
able to make such mistakes.
Another example, why can't systime() just also output julian days, give
it one more keyword and that's it.

Reimar's link was a good tip and made things easier:
http://fermi.jhuapl.edu/s1r/idl/s1rlib/time/time.html
Many many routines converting various time and/or date strings to other
formats (of course no direct conversion to secs-since-1970).

--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: AD&D site / sito AD&D
Next Topic: Time convertion

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

Current Time: Fri Oct 10 16:19:58 PDT 2025

Total time taken to generate the page: 0.07843 seconds