Convert Excel date

Peter M. Brigham, MD pmbrig at gmail.com
Fri Dec 16 14:32:59 CST 2011


Simpler is this:

put "1/01/1900" into d
convert d to dateitems
add 40892 to item 3 of d
convert d to short date
put d

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Dec 15, 2011, at 10:17 PM, DunbarX at aol.com wrote:

> The following is very verbose. I just want you to be able to follow one possible method step by step. Read up on all the commands in the dictionary. Put a breakpoint near the beginning.
> 
> 
> on mouseup 
>  convert the date to seconds
>  put "40892" & "," & it into baseLine
>  ask "Enter excel date"
>  put it - item 1 of baseLine into dayOffset
> put dayOffset * 86400 into newSeconds
> add newSeconds to item 2 of baseLine
> convert item 2 of baseline to date
> answer item 2 of baseLine
> end mouseup
> 
> 
> Craig Newman
> 
> 
> -----Original Message-----
> From: Ludovic Thébault <ludovic.thebault at laposte.net>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Sent: Thu, Dec 15, 2011 12:31 am
> Subject: Convert Excel date
> 
> 
> Hello,
> 
> I've a csv file created by excel.
> Dates are displayed in numbers. (1/01/1900 = 1 so today = 40892)
> 
> Is there a script to convert it in a real date with livecode ?
> 
> Thanks !
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list