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

Home » Public Forums » archive » 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 #24245 is a reply to message #24131] Tue, 20 March 2001 07:19 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Alex Schuster wrote:
>
> 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.

You mean like:

============================================================ ================
Keywords

JULIAN

Set this keyword to specify that the current time is to be returned as a
a double precision floating value containing the current Julian
date/time....
============================================================ ================

Looks like you are in need of an upgrade. By the way, julian time
explicitly includes no leap seconds, meaning you don't have to think
about them. In this sense, it is not tied to any physical period (just
as seconds since Jan 1, 1970 is not) -- it's simply a continuous time
base for ease of intercomparison.

See:

http://hpiers.obspm.fr/webiers/general/syframes/convent/UAI_ b1.html

(credit to Tom McGlynn for the link)

JD
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Time convertion
Next Topic: regular expressions

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

Current Time: Sat Oct 11 10:16:09 PDT 2025

Total time taken to generate the page: 0.54593 seconds