date/time [message #91664] |
Tue, 11 August 2015 11:29  |
joyrles1996
Messages: 27 Registered: August 2015
|
Junior Member |
|
|
how can I get the date / time from the file name in the IDL?
|
|
|
|
|
Re: date/time [message #91673 is a reply to message #91666] |
Wed, 12 August 2015 09:52   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 8/11/15 2:17 PM, Joyrles Fernandes wrote:
> Em terça-feira, 11 de agosto de 2015 16:15:06 UTC-3, ri...@crd.ge.com
> escreveu:
>> On Tuesday, August 11, 2015 at 2:29:55 PM UTC-4, Joyrles Fernandes
>> wrote:
>>> how can I get the date / time from the file name in the IDL?
>>
>> The File_Info() function might be what you need.
>
> NO. I don't need this fuction.
>
> my trouble is in name of file.for example, 2011001.txt, how do i
> write this in format, aaaa/mm/dd?
>
IDL> filename = '2011045.txt'
IDL> year = long(strmid(filename, 0, 4))
IDL> dayofyear = long(strmid(filename, 4, 3))
IDL> jd = julday(1, dayofyear, year)
IDL> print, jd, format='(C(CYI, "/", CMOI2.2, "/", CDI2.2))'
2011/02/14
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
|
|
|
Re: date/time [message #91674 is a reply to message #91666] |
Wed, 12 August 2015 10:15   |
Bill Nel
Messages: 31 Registered: October 2010
|
Member |
|
|
On Tuesday, August 11, 2015 at 4:17:33 PM UTC-4, Joyrles Fernandes wrote:
> Em terça-feira, 11 de agosto de 2015 16:15:06 UTC-3, ri...@crd.ge.com escreveu:
>> On Tuesday, August 11, 2015 at 2:29:55 PM UTC-4, Joyrles Fernandes wrote:
>>> how can I get the date / time from the file name in the IDL?
>>
>> The File_Info() function might be what you need.
>
> NO. I don't need this fuction.
>
> my trouble is in name of file.for example, 2011001.txt, how do i write this in format, aaaa/mm/dd?
And how was anyone supposed to have guessed that from your first post?
|
|
|
Re: date/time [message #91683 is a reply to message #91674] |
Wed, 12 August 2015 18:49  |
joyrles1996
Messages: 27 Registered: August 2015
|
Junior Member |
|
|
Em quarta-feira, 12 de agosto de 2015 14:15:26 UTC-3, ri...@crd.ge.com escreveu:
> On Tuesday, August 11, 2015 at 4:17:33 PM UTC-4, Joyrles Fernandes wrote:
>> Em terça-feira, 11 de agosto de 2015 16:15:06 UTC-3, ri...@crd.ge.com escreveu:
>>> On Tuesday, August 11, 2015 at 2:29:55 PM UTC-4, Joyrles Fernandes wrote:
>>>> how can I get the date / time from the file name in the IDL?
>>>
>>> The File_Info() function might be what you need.
>>
>> NO. I don't need this fuction.
>>
>> my trouble is in name of file.for example, 2011001.txt, how do i write this in format, aaaa/mm/dd?
>
> And how was anyone supposed to have guessed that from your first post?
perfect! Thanks so much.
|
|
|