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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Posix Time Functions [message #17745] Fri, 12 November 1999 00:00
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Ben Tupper <Ben_member@newsguy.com> wrote in message
news:80f3b3$2tm1@edrn.newsguy.com...
> ... 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.

How do people come up with these strange time origins!

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
Re: Posix Time Functions [message #17749 is a reply to message #17745] Thu, 11 November 1999 00:00 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
In article <942358684.298839@clam-55>, "Mark says...
>
> Ben Tupper <Ben_member@newsguy.com> wrote in message
> news:80f3b3$2tm1@edrn.newsguy.com...
>> ... 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.
>
> How do people come up with these strange time origins!
>
Even stranger is that the metadata makes no mention of this date (It took some
group noodling to figure out.)

Ben Tupper
PemaquidRiver@tidewater.net
Re: Posix Time Functions [message #17751 is a reply to message #17749] Thu, 11 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mark Hadfield (m.hadfield@niwa.cri.nz) writes:

> How do people come up with these strange time origins!

You obviously haven't been doing the required reading
in our recent math tutorial. Come on, Mark, get with it! :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Posix Time Functions [message #17754 is a reply to message #17749] Thu, 11 November 1999 00:00 Go 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
Re: Posix Time Functions [message #17764 is a reply to message #17749] Thu, 11 November 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Eric Kihn wrote:
> 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.

How about this:
IDL> julian = systime(/julian)
IDL> caldat, julian, month, day, year, hour, minute, second
IDL> print, julian, month, day, year, hour, minute, second
2451493.9 11 11 1999
8 35 19.999981

Note that my Unix host is set to US Central Standard Time.

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
  Switch to threaded view of this topic Create a new topic Submit Reply
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 14:56:39 PDT 2025

Total time taken to generate the page: 0.00626 seconds