At the moment mine is set to USA format - month/day/year.
i have tried
Code: Select all
put the british date into field "date"
Cheers
Daniel
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
put the british date into field "date"
Code: Select all
set the useSystemDate to true
put the short date into field "date"
Code: Select all
put the system date into the field
produces 2017/12/28put empty into field "Date"
set the useSystemDate to true
put the short date into field "Date"
Code: Select all
on mouseUp
put empty into fld "modDATE"
put empty into fld "origDATE"
set the useSystemDate to true
set the itemDelimiter to "/"
put the dateFormat into PHORMAT
switch (item 1 of PHORMAT)
case "%#d"
put (item 1 of the short date) into DEN
break
case "%#m"
put (item 1 of the short date) into MESETS
break
case "%Y"
put (item 1 of the short date) into GODINA
break
end switch
switch (item 2 of PHORMAT)
case "%#d"
put (item 2 of the short date) into DEN
break
case "%#m"
put (item 2 of the short date) into MESETS
break
case "%Y"
put (item 2 of the short date) into GODINA
break
end switch
switch (item 3 of PHORMAT)
case "%#d"
put (item 3 of the short date) into DEN
break
case "%#m"
put (item 3 of the short date) into MESETS
break
case "%Y"
put (item 3 of the short date) into GODINA
break
end switch
put GODINA && "/" && MESETS && "/" && DEN into fld "modDATE"
put the short date into fld "origDATE"
end mouseUp
Code: Select all
put GODINA && "/" && MESETS && "/" && DEN into fld "modDATE"
If you were looking for specific formatting, regardless of the end users system, why wouldn't you just use the date() function? Seems like "put item 2, item 1, item 3 of the date" would be easier than anything else, once you settle on a format you want to grab from, internet, long, short, etc.richmond62 wrote: ↑Thu Dec 28, 2017 10:16 pmThe "thing" about my script is that if you don't know what your end-user's date format it it doesn't matter.
If you don't know the user's date format, using the systemDate will display it as the user would expect. Then, if you later want a standard format for communication with other apps or a server script, you would specify the English date, dateItems, internet date, or any of the other date formats. You can also use the dateFormat for more granular control.richmond62 wrote: ↑Thu Dec 28, 2017 10:16 pmThe "thing" about my script is that if you don't know what your end-user's date format it it doesn't matter.
This could be useful if you want your standalone to "phone home" with a date, or set an expiry date
for a licence.