Is the DateFormat read only?

Tore Nilsen tore.nilsen at me.com
Wed Oct 28 18:18:03 EDT 2020


You can convert any given date to dateItems. Then you can use dateItems to present the date in any format you like. A date converted to dateItems will give you the following list of items: 

the year
the month number
the day of the month
the hour in 24-hour time
the minute
the second
the numeric day of the week where Sunday is day 1, Monday is day 2, and so forth
All according to the Dictionary.

To be sure that any valid date format is recognized as a date when you read in the date you will like to convert, it is best to ask for the system date or set the useSystemDate to true, as this will make all valid date formats convert to dateItems.

Best regards
Tore Nilsen
> 28. okt. 2020 kl. 22:58 skrev Graham Samuel via use-livecode <use-livecode at lists.runrev.com>:
> 
> A quick test seems to show that the DateFormat can’t be changed by a ‘set’ command.
> 
> How then can I force a date to be in a given format? I’m really thinking of the difference between US and European dates, i.e
> 
> d/m/y versus m/d/y
> 
> Obviously for some types of use, an LC program should be able to force the format for consistency’s sake, regardless of where in the world it’s being run.
> 
> Can it be done?
> 
> Graham
> _______________________________________________
> 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