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

Home » Public Forums » archive » Re: Parsing dates (ARGH!)
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: Parsing dates (ARGH!) [message #39456 is a reply to message #39455] Mon, 17 May 2004 10:41 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Jamie Smyth" wrote...
> Can someone please explain how I can parse the year, month, day, hour,
> minute, and seconds from a timestamp such as '2004-01-01
> 01:22:15.1234'

Probably not the fastest or most elegant but:

IDL> a='2004-01-01 00:10:22'
IDL> ddtt=STRSPLIT(a,' ', /EXTRACT)
IDL> date=STRSPLIT(ddtt[0],'-',/EXTRACT)
IDL> time=STRSPLIT(ddtt[1],':',/EXTRACT)
IDL> print, date
2004 01 01
IDL> print, time
00 10 22

date and time will be 3 element vectors where date[0] is year, time[0] is
hour, date[1] is month, time[1] is minute, etc...

-Rick
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Parsing dates (ARGH!)
Next Topic: Drawind IDL Object graphics ???

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

Current Time: Wed Oct 15 15:28:41 PDT 2025

Total time taken to generate the page: 1.59992 seconds