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

Home » Public Forums » archive » Re: SPLIT numbers into sub-numbers
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: SPLIT numbers into sub-numbers [message #80590 is a reply to message #80587] Fri, 22 June 2012 14:02 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 6/22/12 1:52 PM, k_ghreep@yahoo.com wrote:
> Dear all
> I would like to split the following number 20100115 into year, month
> and day
> any suggestions
> Thanks

Something like this:

IDL> ts = '20100115'
IDL> year = long(strmid(ts, 0, 4))
IDL> month = long(strmid(ts, 4, 2))
IDL> day = long(strmid(ts, 6, 2))
IDL> help, year, month, day
YEAR LONG = 2010
MONTH LONG = 1
DAY LONG = 15

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: astronomy library
Next Topic: Re: Coyote graphics resizeable window

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

Current Time: Fri Oct 10 14:58:29 PDT 2025

Total time taken to generate the page: 0.72104 seconds