User Tools

Site Tools


token:ICUDateTime

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
token:ICUDateTime [2020/05/28 17:59]
JMichaelTX Rewrote the main section to clearly show parameters.
token:ICUDateTime [2023/01/03 00:19] (current)
ccstone
Line 7: Line 7:
 The parameters are specified between `%` signs after the main ICDDateTime token. The parameters are specified between `%` signs after the main ICDDateTime token.
  
-* %**ICUDateTime**%<color #22b14c>[output date format]</​color>​%+* %**ICUDateTime**%*[output date format]*%
   * Returns the current date and time in the specified format.   * Returns the current date and time in the specified format.
-* %**ICUDateTimeFor**%<color blue><​Seconds in [[:unixtime|Unix Time]]></​color>​%<color #​22b14c>​[output date format]</color>​% +  ​Example: ''​%ICUDateTime%EEE, MMM d, yyyy h:mm%''​ ⇢ //Mon, Jan 2, 2023 11:17//
-  * Returns Date/Time specified by the [[:unixtime|Unix Time]], in the user's local time zone. +
-* %**ICUDateTimePlus**%<​color blue><​amount of time></​color>​%<​color #​22b14c>​[unit of time]</​color>​%<​color #​22b14c>​[output date format]</​color>​% +
-  * Returns Date/Time calculated by the Current Date/Time PLUS the <color blue><​amount of time></​color>​ +
-* %**ICUDateTimeMinus**%<​color blue><​amount of time></​color>​%<​color #​22b14c>​[unit of time]</​color>​%<​color #​22b14c>​[output date format]</​color>​% +
-  * Returns Date/Time calculated by the Current Date/Time MINUS the <color blue><​amount of time><​/color>+
  
 +* %**ICUDateTimeFor**%*[unixtime]*%*[output date format]*%
 +  * Returns Date/Time specified by the [[:​unixtime]],​ in the user's local time zone.
 +* %**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 \\ +where: 
-  * angle brackets <color blue><​ ></​color>​ denote a numeric parameter, may use a Variable and/or formula +  * *[output date format]must conform to the [ICU Date/Time codes](https://www.keyboardmaestro.com/action/linkthru?​icudatetimereference). 
-  ​square brackets <color #​22b14c>​[ ]</​color>​ denote a text-only parameter, cannot use a Variable +  * *[unixtime]is the total number of seconds since the start of 1970, GMT (see [[:​unixtime]])
-    *The _text-only_ parameters must be plain text, and be a valid choice for that parameter. +  * *[unit of time]* is a unit as described below
-  * <color #22b14c>[output date format]</​color> ​must conform to the [ICU Date/Time codes](http://userguide.icu-project.org/formatparse/datetime#​TOC-Date-Time-Format-Syntax). +  * *[amount ​of time]* is calculation,​ being the number of *[unit of time]* units to add or subtract.
-  * <color blue><​Seconds in [[:unixtime|Unix Time]]></​color> ​is the total number of seconds since the start of 1970, GMT. +
-  * <color blue><​amount of time></​color>​ is an integer in the units of what you specific in the <color #22b14c>[unit of time]</​color>​ parameter+
-  * <color #22b14c>[unit of time]</​color>​ must be time unit from the below list.+
  
  
Line 70: Line 68:
 The **format** is a specified with an [ICU Date Time Format Specifier](http://​www.stairways.com/​action/​linkthru?​icudatetimereference) which allows you to produce the date in almost any format you desire. The **format** is a specified with an [ICU Date Time Format Specifier](http://​www.stairways.com/​action/​linkthru?​icudatetimereference) which allows you to produce the date in almost any format you desire.
  
-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 [[:​unixtime]] ​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:
  
 ``` ```
Line 80: Line 80:
 ===== Using Variables with These Date/Time Tokens ===== ===== Using Variables with These Date/Time Tokens =====
  
-You can use a number, Variable, and formula using Variables, ​in the _numeric_ parameters, like the amount of time in the  ICUDateTimePlus token, which has this format: \\ +You can use any [[manual:​Calculations|calculation]] ​in the _numeric_ parameters, like the *[amount of time]and *[unit of time]* ​fields.
- +
-%**ICUDateTimePlus**%<​color blue><​amount of time></​color>​%<​color #22b14c>[unit of time]</​color>​%<​color #​22b14c>​[output date format]</​color>​% +
- +
-where \\ +
-  ​angle brackets <color blue><​ ></​color>​ denote a numeric parameter, may use a Variable and/or formula +
-  * square brackets <color #​22b14c>​[ ]</​color>​ denote a text-only parameter, cannot use a Variable+
  
 The _text-only_ parameters must be plain text, and be a valid choice for that parameter. The _text-only_ parameters must be plain text, and be a valid choice for that parameter.
token/ICUDateTime.1590703162.txt.gz · Last modified: 2020/05/28 17:59 by JMichaelTX