Date and Time

Edit

Introduction #

Tokens #

Tokens are used to denote different parts of a datetime string.
They are case-sensitive, and each token must be wrapped in {} to use:
{YYYY MM Do} ❌
{YYYY} {MM} {Do} ✔
{hh:mm} ❌
{hh}:{mm} ✔

  Token Output Description
Year YY 70, 71, … 68, 69 Year without century
  YYYY 1970, 1971, … 2068, 2069 Year with century
Month M 1, 2, … 11, 12 Without leading zero
  Mo 1st, 2nd, … 11th, 12th With ordinals
  MM 01, 02, … 11, 12 With leading zero
  MMM Jan, Feb, … Nov, Dec Short-form month name
  MMMM January, February, … November, December Full month name
Day of the month D 1, 2, … 30, 31 Without leading zero
  Do 1st, 2nd, … 30th, 31st With ordinals
  DD 01, 02, … 30, 31 With leading zero
Day of the week d 0, 1, … 5, 6 0 for Sunday, 1 for Monday, etc
  do 0th, 1st, … 5th, 6th With ordinals
  dd Su, Mo, … Fr, Sa 2 letters
  ddd Sun, Mon, … Fri, Sat 3 letters
  dddd Sunday, Monday, … Friday, Saturday Full name
Hour H 0, 1, … 22, 23 Without leading zero (24h format)
  HH 00, 01, … 22, 23 With leading zero (24h format)
  h 1, 2, … 11, 12 Without leading zero (12h format)
  hh 01, 02, … 11, 12 With leading zero (12h format)
  k 1, 2, … 23, 24 Without leading zero (24h format, where 24: replaces 00:)
  kk 01, 02, … 23, 24 With leading zero (24h format, where 24: replaces 00:)
Minute m 0, 1, … 58, 59 Without leading zero
  mm 00, 01, … 58, 59 With leading zero
Second s 0, 1, … 58, 59 Without leading zero
  ss 00, 01, … 58, 59 With leading zero
AM/PM A AM, PM Uppercase
  a am, pm Lowercase
Time Zone Z -12:00, -11:00, … +11:00, +12:00 With separator
  ZZ -1200, -1100, … 1100, 1200 Without separator
Unix Timestamp X (really long number) Number of seconds since Jan 1 1970 00:00 UTC

Keywords #

These are specific values that can be used instead of tokens for specific inputs/outputs.
Some can be used instead of a Format, while others can be used instead of a Date.
Format keywords are case-sensitive unless they have a next to them.

Formats

Keyword Example
LT 1:23 PM
LTS 1:23:45 PM
L 01/23/2004
l 1/23/2004
LL January 23, 2004
ll Jan 23, 2004
LLL January 23, 2004 1:23 PM
lll Jan 23, 2004 1:23 PM
LLLL Friday, January 23, 2004 1:23 PM
llll Fri, Jan 23, 2004 1:23 PM
ISO 8601
ISO8601
RFC 3339
RFC3339
2004-01-23T13:23:45+00:00
Twitch 2004-01-23T13:23:45Z

Dates

  • yesterday
  • today
  • tomorrow


Edit

Get Date/Time #

Returns the current Date/Time, in the format provided.

Box Name Type Description
Format String String including date/time tokens
Variable Name String Variable to save the string in
Token(s) used Result
{YY}{MM}{DD} 040123
{hh}:{mm}:{ss}{a} on {Do} {MMM} {YYYY} 1:23:45pm on 23rd Jan 2004
{YYYY}-{MM}-{DD}T{HH}:{mm}:{ss}{Z}
Twitch
2022-01-23T13:23:45+00:00


Edit

Date/Time Math #

Returns a Date/Time, in the format specified, after adding or subtracting an amount of time. Includes your computer’s timezone in the calculation.

Box Name Type Description
Variable Name String Variable to save the string in.
Input Format String String including date/time tokens.
Date/Time String Datetime String in the Input format.
Operator Dropdown += or -=
Number/Variable String Amount to be added or subtracted.
Unit Dropdown Seconds, Minutes, Hours, Days, Months, or Years.
Output Format String String including date/time tokens. It’s equal to Input Format if it’s left empty.


Edit

Date/Time Diff #

Returns the duration between 2 datetimes, in the unit specified.
The second date is subtracted from the first, so today - yesterday will return a positive number, while yesterday - today will return a negative number.

Box Name Type Description
Variable Name String Variable to save the result in
Format String String including date/time tokens
Date/Time String Datetime String in the Input format
Date/Time String Datetime String in the Input format
Unit Dropdown Seconds, Minutes, Hours, Days, Months, or Years


Edit

Date/Time Duration #

Converts a duration into an object with the breakdown of years, months, days, hours, minutes, and seconds. Optionally adds or subtracts an amount before converting.

Box Name Type Description
Variable Name String Variable to save the resulting object in.
Duration String Input duration value.
Unit Dropdown Unit of the input duration: Seconds, Minutes, Hours, Days, Months, or Years.
Operator Dropdown Whether to add (+=) or subtract (-=) an additional amount from the duration before converting.
Number/Variable String Amount to add or subtract. Can be 0 to skip the math step.
Unit Dropdown Unit of the amount being added or subtracted: Seconds, Minutes, Hours, Days, Months, or Years.
Output Format Dropdown Largest unit to include in the result object: Seconds, Minutes, Hours, Days, Months, or Years.

The saved object contains the following keys, depending on the selected Output Format:

Key Type Description
second Number Remaining seconds (0–59).
minute Number Remaining minutes (0–59). Included when Output Format is Minutes or larger.
hour Number Remaining hours (0–23). Included when Output Format is Hours or larger.
day Number Remaining days within the month. Included when Output Format is Days or larger.
month Number Remaining months (0–11). Included when Output Format is Months or larger.
year Number Remaining years. Included when Output Format is Years.

Example: an input of 3661 seconds with no math and Output Format set to Hours saves an object with { "hour": 1, "minute": 1, "second": 1 }.


Edit

Convert Time #

Converts a time value from one unit into a formatted duration string.

Box Name Type Description
Input Time Number / String Time value to convert. Can be a number or a variable.
Input Format Dropdown Input unit. Available units are Seconds, Minutes, Hours, Days, and Months.
Output Format Dropdown / String Format string for the result. You can select a preset or type your own.
Save Variable As String Variable name where the converted time string will be saved.

Months are treated as 30 days for duration conversion.

Output tokens #

Token Description Example
{ss} Second part with leading zero. 04
{s} Total seconds. 100
{mm} Minute part with leading zero. 01
{m} Total minutes. 1
{HH} Total hours with leading zero. 25
{H} Total hours. 25
{hh} Hour part inside the current day with leading zero. 01
{h} Total hours. 25
{DD} Total days with leading zero. 01
{D} Total days. 1

Examples:

Input Time Input Format Output Format Result
100 Seconds {m}:{ss} 1:40
3661 Seconds {HH}:{mm}:{ss} 01:01:01
90061 Seconds {D}d {hh}:{mm}:{ss} 1d 01:01:01