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

Home » Public Forums » archive » Re: Time conversion
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: Time conversion [message #23279] Thu, 18 January 2001 08:51
Kelly Dean is currently offline  Kelly Dean
Messages: 92
Registered: March 1997
Member
Thanks for your suggestions....

However, I found what I was looking for. Using the search engine on the
U of W Astronomy IDL Page, I found that Paul Ricchiazzi already developed
an IDL routine - ARMbasetime.pro - that converted the number of seconds
since Jan 1, 1970 00:00:00 UTC into yy, mm, dd, and hh. Very useful......

Also, I discovered that William Weibel from UCLA developed some handy
NetCDF routines that proved to be useful with extracting the values from
the NetCDF files.

Kelly

Kelly Dean wrote:

> I have several NetCDF files with the time listed as seconds since
> 1970-1-1 0:00:00 GMT. Are there any routines in IDL that will convert
> this number to Month, Day, Year, Hour, Minute, and Seconds?
>
> Example: 816134420 ( Nov 12 1995 )
>
> Kelly Dean
> CSU/CIRA
Re: Time conversion [message #23309 is a reply to message #23279] Wed, 17 January 2001 09:18 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Kelly Dean wrote:
>
> I have several NetCDF files with the time listed as seconds since
> 1970-1-1 0:00:00 GMT. Are there any routines in IDL that will convert
> this number to Month, Day, Year, Hour, Minute, and Seconds?
>
> Example: 816134420 ( Nov 12 1995 )
>
> Kelly Dean
> CSU/CIRA


Our timeformat is based on seconds since 2000-01-01 00:00:00 UTC. This
definition
of Julian Seconds was first developed by Ray Sterner (JHUASPL). You
will be able
to use our and Rays formatting routines if you add the offset first to
these numbers.


http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/js2string.tar.gz


; NAME:
; js2string
;
; PURPOSE:
; This function converts JulianSeconds to a string, works with array
input
;
; CATEGORY:
; TIME
;
; CALLING SEQUENCE:
; Result= JS2STRING(Julsec)
;
; INPUTS:
; Julsec: double
;
; OUTPUTS:
; Result: string or string array depending input
;
; KEYWORD PARAMETERS:
; YEAR2: 2 digit year
; NO_LEADING_ZERO: no leading zero at all positions
; NOW: returns actual time instead of input time
; FORMAT: string to format the output:
; 'ICG' = 'Y-M-D H:M:S MS'
; 'XLS' = 'D.M.Y H:M:S'
; 'M-D'
; 'H:M'
; 'H:M:S'
; 'Y-M-D'
; 'M-D-Y'
; 'YMDHMS'
;
; EXAMPLE:
; IDL> x= js2string(-12345678D, FORM='y-m-d h:m:s') & PRINT, x
; 1999-08-11 02:38:42
; IDL> x= js2string(-12345678D, FORM='y_m_d_h_m') & PRINT, x
; 1999_08_11_02_38
; IDL> x= js2string(-12345678D, /STR) & HELP, x ,/STR
; ** Structure <f27108>, 8 tags, length=64, refs=1:
; YEAR STRING '1999'
; MONTH STRING '08'
; DAY STRING '11'
; WDAY STRING 'Wednesday'
; HOUR STRING '02'
; MIN STRING '38'
; SEC STRING '42'
; MSEC STRING '000'



For further routines and licensing please look at

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml


--
R.Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
=============================================
a IDL library at ForschungsZentrum J�lich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
Re: Time conversion [message #23326 is a reply to message #23309] Tue, 16 January 2001 14:01 Go to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Kelly Dean wrote:
> I have several NetCDF files with the time listed as seconds since
> 1970-1-1 0:00:00 GMT. Are there any routines in IDL that will convert
> this number to Month, Day, Year, Hour, Minute, and Seconds?
>
> Example: 816134420 ( Nov 12 1995 )

Here's the first place I'd look:
http://fermi.jhuapl.edu/s1r/idl/s1rlib/time/time.html

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDLgrAxis object with /LOG keyword
Next Topic: Re: multiple filters take 2

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

Current Time: Sun Oct 12 12:53:03 PDT 2025

Total time taken to generate the page: 1.36091 seconds