User Tools

Site Tools


token:ICUDateTime

**This is an old revision of the document!**

ICU Date/Time Tokens

The %ICUDateTime%, %ICUDateTimePlus%, %ICUDateTimeMinus% and %ICUDateTimeFor% tokens return the a date formatted in a specific format. More details are provided in the Dates and Times article.

Fields & Format Used by These Tokens

  • %ICUDateTime%format% - the current date and time.
  • %ICUDateTimeFor%NOW()+20%format% - the specified unixtime date.
  • %ICUDateTimePlus%36%Hours%format% - the current time plus a specified number of the specified time units. * %ICUDateTimeMinus%36%Hours%format% - the current time minus a specified number of the specified time units.

Time Units

The available time units for %ICUDateTimePlus% and %ICUDateTimeMinus% are:

  • Seconds
  • Minutes
  • Hours
  • Days
  • Weeks
  • Months
  • Years

Format Specification

The format is a specified with an ICU Date Time Format Specifier 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:

%ICUDateTimeFor% TIME(2015, 8, 23,12,0,0) %EEE, MMM d, yyyy%

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.

Using Variables with These Date/Time Tokens

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:

%ICUDateTimePlus%3%Days%yyyyMMdd%
%ICUDateTimePlus%YourVariableName%Days%yyyyMMdd%

For an example, see Generate File Named Based on Day of Week [Example]

See Also


Actions

Functions

Tokens

Topics

Forum

token/ICUDateTime.1470104909.txt.gz · Last modified: 2016/08/01 22:28 by JMichaelTX