token:ICUDateTime
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| token:ICUDateTime [2016/12/28 09:20] – 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. | + | |
| + | * %**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]*. | ||
| - | ===== Time Units ===== | + | 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 23: | Line 36: | ||
| * Months | * Months | ||
| * Years | * Years | ||
| + | * Sundays | ||
| + | * Mondays | ||
| + | * Tuesdays | ||
| + | * Wednesdays | ||
| + | * Thursdays | ||
| + | * Fridays | ||
| + | * Saturdays | ||
| + | |||
| + | ==== Using Plus 0 or 1 With Day of Week (v8+) ==== | ||
| + | |||
| + | * If the //Time Unit// is a day of the week (// | ||
| + | * **If you use a Plus 0** (// | ||
| + | it will return the next appropriate day for that day of week, possibly returning today if it is the same day of week as entered; | ||
| + | * So if Today is // | ||
| + | * Whereas, if you use // | ||
| + | * **If you use Plus 1** (// | ||
| + | it will return the next appropriate day, strictly after Today. | ||
| + | |||
| + | === Examples === | ||
| + | |||
| + | |||
| + | For example, if today is Tuesday, September 5, 2017, you would get these results: | ||
| + | |||
| + | ^Token^Result^ | ||
| + | | %ICUDateTimePlus%0%Tuesdays%EEE, | ||
| + | |||
| + | Note how Plus 0 and Plus 1 are the same unless today is the same as the weekday. | ||
| ===== Format Specification ===== | ===== Format Specification ===== | ||
| Line 28: | 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 38: | Line 80: | ||
| ===== Using Variables with These Date/Time Tokens ===== | ===== Using Variables with These Date/Time Tokens ===== | ||
| - | To use a Variable instead of a number | + | You can use any [[manual: |
| + | |||
| + | The _text-only_ parameters must be plain text, and be a valid choice for that parameter. | ||
| + | |||
| + | **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 |
| - | ===== See Also ===== | + | * [[https:// |
| + | * [Generate File Named Based on Day of Week [Example]](https:// | ||
| - | ---- | + | ===== Localization ===== |
| - | === Actions === | + | Prior to Mojave, and after Keyboard Maestro 9.0, dates should be in your chosen language. |
| + | |||
| + | ===== See Also ===== | ||
| + | |||
| + | ==== Actions | ||
| * [[action: | * [[action: | ||
| * [[: | * [[: | ||
| - | === Functions === | + | ==== Functions |
| * [[function: | * [[function: | ||
| Line 69: | Line 121: | ||
| * [[: | * [[: | ||
| - | === Tokens === | + | ==== Tokens |
| * [[token: | * [[token: | ||
| Line 81: | Line 133: | ||
| * [[: | * [[: | ||
| - | === Topics === | + | ==== Topics |
| * [[:Dates and Times|Dates and Times]] | * [[:Dates and Times|Dates and Times]] | ||
| Line 87: | Line 139: | ||
| * [[: | * [[: | ||
| - | ---- | + | ===== Forum ===== |
| - | + | ||
| - | ==== Forum ==== | + | |
| - [[https:// | - [[https:// | ||
| - [[https:// | - [[https:// | ||
| - | - [[https://www.google.fr/search?q=site: | + | - [[https://forum.keyboardmaestro.com/ |
token/ICUDateTime.1482916841.txt.gz · Last modified: by peternlewis
