Page 1 of 1

useSystemDate

Posted: Wed Oct 28, 2009 1:44 pm
by exheusden
My MacOS X (10.5.8) system dates are set to display in dd/mm/yyyy format, e.g.:

Monday, 5 January 2009
Monday, 5 January 2009
5 Jan 2009
05/01/2009

A stack contains the following in Basic Properties:

Code: Select all

on openStack
   
   set the useSystemDate to true
   
end openStack
Yet the following script, at field level, results in the American format of the date being put into the field "modified":

Code: Select all

on closeField
   if the short name of the target = "Notes" then exit closeField
   put the long English date into fld "modified"
end closeField
(also tried without the "English" -- same result)

In today's case, this is shown as "Wednesday, October 28, 2009"

How do I get this to show as "Wednesday, 28 October 2009"?

Posted: Wed Oct 28, 2009 1:57 pm
by Klaus
Hi exheusden,

"usesystemdate" is a local property!
That means you have to declare it in each handler where you need it:

Code: Select all

on closeField 
   set the useSystemDate to true
   if the short name of the target = "Notes" then exit closeField 
   put the long English date into fld "modified" 
end closeField
Best

Klaus

Posted: Wed Oct 28, 2009 3:17 pm
by exheusden
That makes no difference, I'm afraid!

Edit: got it to work: not only must useSystemDate be set to true in rach handler, but the "English" must be left out. The following works:

Code: Select all

on closeField 
   set the useSystemDate to true 
   if the short name of the target = "Notes" then exit closeField 
   put the long date into fld "modified" 
end closeField
Thanks for your help.

Posted: Wed Oct 28, 2009 3:49 pm
by Klaus
Ah, yes, overlooked this one.

On the other hand directly using "put the system date..." might even save some scripting in that case :-)

Best

Klaus

Posted: Wed Oct 28, 2009 4:29 pm
by exheusden
Ooh, that's a nice one to know!

Diolch yn fawr (thanks).