token:ICUDateTime
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| token:ICUDateTime [2019/07/01 06:56] – peternlewis | token:ICUDateTime [2023/01/03 05:19] (current) – ccstone | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| The // | The // | ||
| - | ===== Fields & Format Used by These Tokens ===== | + | ===== Required Parameters for ICUDateTime |
| + | The parameters are specified between `%` signs after the main ICDDateTime token. | ||
| - | * // | + | * %**ICUDateTime**%*[output |
| - | * // | + | * Returns |
| - | * // | + | * Example: '' |
| - | * //%ICUDateTimeMinus%3+6%Hours%**format**%// - the current time minus a specified number of the specified time units. | + | |
| - | ===== Time Units ===== | + | * %**ICUDateTimeFor**%*[unixtime]*%*[output date format]*% |
| + | * Returns Date/Time specified by the [[: | ||
| + | * %**ICUDateTimePlus**%*[amount of time]*%*[unit of time]*%*[output date format]*% | ||
| + | * Returns Date/Time calculated by the Current Date/Time **plus** the *[amount of time]*. | ||
| + | * %**ICUDateTimeMinus**%*[amount of time]*%*[unit of time]*%*[output date format]*% | ||
| + | * Returns Date/Time calculated by the Current Date/Time **minus** the *[amount of time]*. | ||
| + | |||
| + | where: | ||
| + | * *[output date format]* must conform to the [ICU Date/Time codes](https:// | ||
| + | * *[unixtime]* is the total number of seconds since the start of 1970, GMT (see [[: | ||
| + | * *[unit of time]* is a unit as described below. | ||
| + | * *[amount of time]* is a calculation, | ||
| + | |||
| + | |||
| + | ===== Unit of Time ===== | ||
| The available time units for // | The available time units for // | ||
| Line 54: | Line 68: | ||
| The **format** is a specified with an [ICU Date Time Format Specifier](http:// | The **format** is a specified with an [ICU Date Time Format Specifier](http:// | ||
| - | Keep in mind that TIME is in GMT and the output of ICUDateTimeFor is in local time, so when doing this sort of thing it is best to use midday instead of midnight: | + | You can use the *Insert ICU Date Field* menu in the *Edit* menu to insert various ICU Date Field format tokens. The *Insert ICU Date Field by Name…* menu item may be particularly helpful to quickly insert field components. |
| + | |||
| + | Keep in mind that [[: | ||
| ``` | ``` | ||
| Line 62: | Line 78: | ||
| which will generally work anywhere since at midday GMT, the entire world (almost) is on the same date. Otherwise, folks with negative GMT offsets (which includes all of the Americas for example) will get the wrong result. | which will generally work anywhere since at midday GMT, the entire world (almost) is on the same date. Otherwise, folks with negative GMT offsets (which includes all of the Americas for example) will get the wrong result. | ||
| - | ===== Localization | + | ===== Using Variables with These Date/Time Tokens |
| - | Prior to Mojave, and after Keyboard Maestro 9.0, dates should be in your chosen language. | + | You can use any [[manual: |
| - | ===== Using Variables with These Date/Time Tokens ===== | + | The _text-only_ parameters must be plain text, and be a valid choice for that parameter. |
| - | To use a Variable instead of a number in a token, like the ICUDateTimePlus token, just enter the Variable name without any additional %, as in: | + | **Examples** |
| ``` | ``` | ||
| - | %ICUDateTimePlus%3%Days%yyyyMMdd% | + | %ICUDateTimePlus%3%Days%MM/dd/yyyy% |
| - | %ICUDateTimePlus%YourVariableName%Days%yyyyMMdd% | + | %ICUDateTimePlus%myAmountOfTime%Days%yyyyMMdd% |
| + | %ICUDateTimePlus%myBaseNumber + 3%Months%yyyy-MM-dd% | ||
| ``` | ``` | ||
| - | For an example, see [Generate File Named Based on Day of Week [Example]](https:// | + | Also See |
| + | |||
| + | * [[https:// | ||
| + | * [Generate File Named Based on Day of Week [Example]](https:// | ||
| + | |||
| + | ===== Localization ===== | ||
| + | |||
| + | Prior to Mojave, and after Keyboard Maestro 9.0, dates should be in your chosen language. | ||
| ===== See Also ===== | ===== See Also ===== | ||
token/ICUDateTime.1561964203.txt.gz · Last modified: by peternlewis
