Date Conversion Problem - Another Kick at the Cat

Mark Smith mark at maseurope.net
Fri Dec 14 08:23:36 EST 2007


Gregory, if your system is set to use US dates (mm/dd/yy) then  
that'll be the format for rev's 'short system date'.
If you have a look at the 'formats' tab in the 'international' system  
preferences, you'll see what your system is currently set to.

So if you know that the dates in your file are in the "dd/mm/yy"  
format, and your system setting is for "mm/d/yy" you'll probably have  
to swap the d and m fields yourself, before converting them to what  
you want. So you could have this function in your app.

function convertDate pDate
   set the itemdelimiter to "/"
   put item 2 of pDate & "/" & item 1 of pDate & "/" item 3 of pDate  
into nDate
   convert nDate to abbrev english date
   return nDate
end convertDate



Best,

Mark


On 14 Dec 2007, at 12:56, Gregory Lypny wrote:

> Hello everyone,
>
> I sent out this question the other day but no takers.  Hoping  
> someone might have an answer.
>
> Regards,
>
> 	Gregory
>
> On Wed, Dec 12, 2007, at 1:00 PM, Gregory Lypny wrote:
>
>> Hello everyone,
>>
>> A date conversion problem has cropped up in one of my stacks.  I have
>> a handler that starts with
>>
>> 	set useSysemDate to true
>>
>> I'm processing tab-delimited text files, so later in the handler I
>> have the line
>>
>> 	convert the fourth item of aData[theDate] to abbrev English date
>>
>> Now, the dates in the text file are in short format, dd/mm/yyyy,  
>> e.g.,
>> 10/12/2007 for Monday, December 10th, and I'm converting them to my
>> system's medium format in Leopard, which is Mon, Dec 10, 2007, but
>> what I'm getting is the incorrect date because it is coming out in
>> American format, mm/dd/yyyy or Fri, Oct 12, 2007.
>>
>> Is this a Leopard problem?  Because I never had it before I upgraded.
>> Dates are critical to my work, so any suggestions would be most
>> appreciated.
>>
>> Incidentally, I'm using Revolution 2.8.1 Build 470 and Leopard 10.5.1
>> on an Intel iMac.
>>
>> Regards,
>>
>> 	Gregory
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list