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

Home » Public Forums » archive » Re: Posix Time Functions
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: Posix Time Functions [message #17754 is a reply to message #17749] Thu, 11 November 1999 00:00 Go to previous messageGo to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
In article <382A51B0.44D1CB18@mindspring.com>, Eric says...
>
> I posted this a while a go but didn't hear anything so I thought I'd
> take one more shot. Does anyone know of / have any POSIX time functions
> for IDL? That is a function which takes seconds since Jan, 1 1970 and
> returns a nice date structure (year, month, day,etc..). Such beasties
> are plentiful in Java, C etc so I figure one should be in IDL also.
>
>

Try something like this... I just happened to need something like this recently
when working with instrument data. Each measurement was stamped with Julian
seconds elapsed since October 15, 1582.


FUNCTION POSIX_TIME, Seconds


;convert seconds since 1-1-1970 to a comparable Julian Days elapsed
ElapsedJulianDays = Seconds/(60.*60.*24.)

; get the Julian day number for the benchtime
BenchTimeJulianDay = JulDay(1,1,1970)

; add the number of days elapsed to the BenchTime less one
TargetDayJulian = ElapsedJulianDays + BenchTimeJulianDay - 1.

; convert back to familiar calendar date
CalDat, TargetDayJulian, Month, Day, Year

Return, {Month:Month, Day:Day, Year:Year}

End

Ben Tupper
PemaquidRiver@tidewater.net
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Zoom
Next Topic: TRIANGULATE says "Points are co-linear, no solution"

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

Current Time: Wed Oct 08 19:25:24 PDT 2025

Total time taken to generate the page: 0.00509 seconds