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

Home » Public Forums » archive » Re: date format
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: date format [message #72452] Thu, 09 September 2010 19:21
mkmvarma is currently offline  mkmvarma
Messages: 24
Registered: November 2007
Junior Member
On Sep 10, 1:05 pm, Ben Tupper <ben.bigh...@gmail.com> wrote:
> On 9/9/10 6:51 PM, mahesh wrote:
>
>> Hi,
>> Is there any way I can change the date format from '970625' to
>> '19970625' in IDL?
>> Thanks,
>> Mahesh
>
> Hi,
>
> I hesitate to give the easy answer, but what the heck.  IDL can do
> string math so the following works a treat.
>
> dateString = '970625'
> newDateString = '19' + dateString
>
> But if you really need to do date math then you need to split the string
> into a 2-digit-year, a month and a day using STRMID.  Add the century
> (1900) to the 2-digit date.  Then you run the while thing JULDAY before
> doing math on it.
>
> Cheers,
> Ben

Thanks very much, Ben. It worked.. I had to use STRMID though ....
Mahesh
Re: date format [message #72453 is a reply to message #72452] Thu, 09 September 2010 18:05 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On 9/9/10 6:51 PM, mahesh wrote:
> Hi,
> Is there any way I can change the date format from '970625' to
> '19970625' in IDL?
> Thanks,
> Mahesh

Hi,

I hesitate to give the easy answer, but what the heck. IDL can do
string math so the following works a treat.

dateString = '970625'
newDateString = '19' + dateString


But if you really need to do date math then you need to split the string
into a 2-digit-year, a month and a day using STRMID. Add the century
(1900) to the 2-digit date. Then you run the while thing JULDAY before
doing math on it.

Cheers,
Ben
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: date format
Next Topic: reverse color table

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

Current Time: Wed Oct 08 15:14:42 PDT 2025

Total time taken to generate the page: 0.00433 seconds