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

Home » Public Forums » archive » Re: number of seconds since 1/1/1970
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: number of seconds since 1/1/1970 [message #3759 is a reply to message #3757] Tue, 14 March 1995 07:17 Go to previous messageGo to previous message
sterner is currently offline  sterner
Messages: 106
Registered: February 1991
Senior Member
knipp@ipi.uni-hannover.de (K Knipp) writes:

> I'm sure it's in the libraries but I can't find it:
> I need a function to convert any given date (not the actual one)
> to the number of seconds elapsed since Jan 1st, 1970.

My IDL library has a routine called dt_tm_tojs (date and time to
Julian Seconds) which converts a date and time to the number of
seconds after 2000 Jan 1 0:00. A simple difference will give the
value you need. Here is an example use:

js0 = dt_tm_tojs('1970 jan 1 0:00')
sec = dt_tm_tojs('1990 mar 14 10:15')-js0
print,sec
6.3740970e+08

There is also the inverse, dt_tm_fromjs, which allows fairly flexible
formatting of the result. Many other time related routines are
available in this library. These are documented in the following
web page:
ftp://fermi.jhuapl.edu/www/s1r/idl/s1rlib/time/time.html
Information on obtaining the library is also on that page.

If you don't have web access (a very unfortunate circumstance)
you can get the library as follows:

ftp fermi.jhuapl.edu
login: anonymous
password: enter your email address
cd pub/idl
get README
bye

Follow the instructions in the README (~6.6k bytes) file to get the
actual library. You may also
want to get the one line description file cat.one (~30kb).

Ray Sterner sterner@tesla.jhuapl.edu
The Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
WWW Home page: ftp://fermi.jhuapl.edu/www/s1r/people/res/res.html
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Calculate convex hull of scattered data?
Next Topic: New User seeks book

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

Current Time: Sat Oct 11 02:23:20 PDT 2025

Total time taken to generate the page: 1.20072 seconds