Automate

Automate

Make your phone or tablet smarter with automation

Get it on Google Play

dateParse

number dateParse(text, pattern, timeZone, language)

Returns a timestamp in timeZone parsed from text formatted according to pattern in language.

Pattern symbols with special meaning:

SymbolComponentExamples
GEraAD
yYear2014
MMonthJuly; Jul; 07; 7
wWeek in year27
WWeek in month2
DDay in year189
dDay in month (1-31)10
EDay of weekTuesday; Tue; T
FDay of week in month (2nd Wed in July)2
HHour in day (0-23)0
kHour in day (1-24)24
KHour in am/pm (0-11)0
hHour in am/pm (1-12)12
aAm/pm markerPM
mMinute in hour30
sSecond in minute55
SMillisecond978
ZTime zone offset-0800
zTime zone namePacific Standard Time; PST; GMT-08:00
'Avoid interpretation'day' d
''Single quote''o'clock'

Note! Use timeZone "UTC" when parsing time only into an timestamp “time of day”, seconds since midnight, value as used by most blocks.

Parameters

  1. text — text to parse.
  2. pattern — formatting pattern.
  3. timeZone — optional time zone, defaults is current time zone.
  4. language — optional language code, defaults is the device language.

Returns

Note! This documentation is also accessible within the app from Help & feedback menu.