User Tools

Site Tools


Dates_and_Times

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 Both sides next revision
Dates_and_Times [2017/09/07 00:11]
peternlewis
Dates_and_Times [2019/07/01 02:55]
peternlewis
Line 1: Line 1:
-{{:​date_and_time-icon.gif|}} 
- 
 Dates and Times Dates and Times
 =============== ===============
Line 9: Line 7:
  
 ===== Examples ===== ===== Examples =====
 +
 ==== 1. Get Current Date/Time ==== ==== 1. Get Current Date/Time ====
- 
  
 The most commonly used token is for returning the current date/time in the format you like: The most commonly used token is for returning the current date/time in the format you like:
Line 20: Line 18:
  
 ==== 2. Add Time to Date ==== ==== 2. Add Time to Date ====
 +
 This example adds days to the current date using a Keyboard Maestro Variable. ​ See below for other options.{{:​add-days-current-date-km-7.3.png?​nolink|}} This example adds days to the current date using a Keyboard Maestro Variable. ​ See below for other options.{{:​add-days-current-date-km-7.3.png?​nolink|}}
  
 For more info see this Forum Topic: ​ [Add Time to Current Date @Example](https://​forum.keyboardmaestro.com/​t/​date-add-time-to-current-date-example/​7213),​ which provides instructions and a complete macro. For more info see this Forum Topic: ​ [Add Time to Current Date @Example](https://​forum.keyboardmaestro.com/​t/​date-add-time-to-current-date-example/​7213),​ which provides instructions and a complete macro.
- 
---- 
- 
  
  
Line 115: Line 111:
 * [[unixtime]] in GMT * [[unixtime]] in GMT
  
-==== Mixing Functions and Tokens ====+===== Mixing Functions and Tokens ​=====
  
 You might expect [[token:​ICUDateTimeFor|%ICUDateTimeFor%]] [[function:​TIME|TIME(2017,​ 1, 1)]] `%EEE, MMM d, yyyy%` to yield `Sun, Jan 1, 2017`. However, it may yield `Sat, Dec 31, 2016`, depending on your local time zone. You might expect [[token:​ICUDateTimeFor|%ICUDateTimeFor%]] [[function:​TIME|TIME(2017,​ 1, 1)]] `%EEE, MMM d, yyyy%` to yield `Sun, Jan 1, 2017`. However, it may yield `Sat, Dec 31, 2016`, depending on your local time zone.
Line 131: Line 127:
  
 For a more complete discussion on the many different ways to use date and times, see [KM dates & times: Notes on anchors, intervals, and translations](https://​forum.keyboardmaestro.com/​t/​km-dates-times-notes-on-anchors-intervals-and-translations/​1935) (Aug 2015), with contributions by @[ComplexPoint](https://​forum.keyboardmaestro.com/​users/​ComplexPoint),​ @[peternlewis](https://​forum.keyboardmaestro.com/​users/​peternlewis),​ and others. For a more complete discussion on the many different ways to use date and times, see [KM dates & times: Notes on anchors, intervals, and translations](https://​forum.keyboardmaestro.com/​t/​km-dates-times-notes-on-anchors-intervals-and-translations/​1935) (Aug 2015), with contributions by @[ComplexPoint](https://​forum.keyboardmaestro.com/​users/​ComplexPoint),​ @[peternlewis](https://​forum.keyboardmaestro.com/​users/​peternlewis),​ and others.
 +
 +===== Localization =====
 +
 +Prior to Mojave, and after Keyboard Maestro 9.0, dates should be in your chosen language. ​ Unfortunately Apple changed Mojave and later to make the system return dates only in the Keyboard Maestro localized language (ie, English), regardless of your chosen locale. ​ Keyboard Maestro 9.0 works around this by claiming to be in all locales, even though it is really only localized for English itself.
  
 ===== See Also ===== ===== See Also =====
  
-=== Actions ===+==== Actions ​====
  
 * [[action:​Filter|Filter]] (Process Text Tokens) * [[action:​Filter|Filter]] (Process Text Tokens)
Dates_and_Times.txt ยท Last modified: 2023/06/20 02:44 by peternlewis