convert | ||||||||||
Type | command | |||||||||
Dictionary | LCS | |||||||||
Library | LiveCode Script | |||||||||
Syntax |
| |||||||||
Summary | Changes a date, a time, or a date and time to a specified format. | |||||||||
Introduced | 1.0 | |||||||||
OS | mac, windows, linux, ios, android, web | |||||||||
Platforms | desktop, server, mobile | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Values |
| |||||||||
Related | Keyword: dateItems, system, long, short, string, seconds, abbreviated, internet, english, it Operator: is a Property: useSystemDate, centuryCutoff, twelveHourTime Command: sort container Function: time, dateFormat, milliseconds, date Glossary: format, keyword, variable, command, container | |||||||||
Description | Use the convert command to change a date or time to a format that's more convenient for calculation or display. The dateItems format is a comma-separated list of numbers:
The convert command can handle dates in dateItems format where one or more of the items is out of the normal range. This means you can add arbitrary numbers to an item in the dateItems and let the convert command handle the calculations that span minute, hour, day, month, and year boundaries. For example, suppose you start with 9:30 AM, convert that time to dateItems format, then add 45 minutes to item 5 (the minute) of the resulting value. This gives you 75 as the minute. When you convert the value to any other time format, the convert command automatically converts "75 minutes" to "1 hour and 15 minutes" :
You can optionally use the english or system keyword before the short, abbreviated, or long date or time. If the useSystemDate is true, or if you use the system keyword, the user's current system preferences are used to format the date or time. Otherwise, the standard US date and time formats are used. The internet date, seconds, and dateItems formats are invariant and do not change according to the user's preferences.
| |||||||||
Tags | math |