Parse, validate, manipulate, and display dates.
Reference : moment.js
Categories > Date&time > rex_momentjsIntroductionLinksDependenceUsageSet dateFormat of date stringISO 8601 formatCustom formatFormat is validGet dateDisplay dateManipulationAddElapsed timeStart or end of date timeTime zone
None
Action:Current date  (sample capx)
Action:Unix timestamp  (sample capx)
Action:Date string
Parameter Format
"" : ISO 8601. see next sectionAction:Set component
Action:Clone
Date part
2013-02-08, a calendar date part2013-W06-5, a week date part2013-039, an ordinal date part20130208, basic (short) full date2013W065, basic (short) week, weekday2013W06, basic (short) week only2013050, basic (short) ordinal dateTime part, separated from the date part by a space  or a uppercase T
2013-02-08T09, an hour time part separated by a T2013-02-08 09, an hour time part separated by a space 2013-02-08 09:30, an hour and minute time part2013-02-08 09:30:26, an hour, minute, and second time part2013-02-08 09:30:26.123, an hour, minute, second, and millisecond time part2013-02-08 24:00:00.000, hour 24, minute, second, millisecond equal 0 means next day at midnight20130208T080910,123, short date and time up to ms, separated by comma ,20130208T080910.123, short date and time up to ms20130208T080910, short date and time up to seconds20130208T0809, short date and time up to minutes20130208T08, short date and time, hours onlyAny of the date parts can have a time part
2013-02-08 09, a calendar date part and hour time part2013-W06-5 09, a week date part and hour time part2013-039 09, an ordinal date part and hour time partIf a time part is included, an offset from UTC can also be included as +-HH:mm, +-HHmm, +-HH or Z
2013-02-08 09+07:00, +-HH:mm2013-02-08 09-0100, +-HHmm2013-02-08 09Z, Z2013-02-08 09:30:26.123+07:00, +-HH:mm2013-02-08 09:30:26.123+07, +-HHFormat is composed by these components, and ignores non-alphanumeric characters.
Year, month, and day tokens
YYYY : 4 or 2 digit year (2014)YY : 2 digit year (14)Y : Year with any number of digits and sign (-25)Q :Quarter of year. Sets month to first month in quarter. (1..4)M MM : Month number (1..12)MMM MMMM : Month name in locale (Jan..December)D DD : Day of month (1..31)Do : Day of month with ordinal (1st..31st)DDD DDDD : Day of year (1..365)X : Unix timestamp (1410715640.579)x : Unix ms timestamp (1410715640579)Week year, week, and weekday tokens
gggg : Locale 4 digit week year (2014)gg : Locale 2 digit week year (14)w ww : Locale week of year (1..53)e : Locale day of week (0..6)ddd dddd : Day name in locale (Mon...Sunday)GGGG : ISO 4 digit week year (2014)GG : ISO 2 digit week year (14)W WW : ISO week of year (1..53)E : ISO day of week (1..7)Hour, minute, second, millisecond, and offset tokens
H HH : 24 hour time (0..23)h hh : 12 hour time used with a A. (1..12)a A : Post or ante meridiem (Note the one character a p are also considered valid) (am pm)m mm : Minutes (0..59)s ss : Seconds (0..59)S SS SSS : Fractional seconds (0..999)Z ZZ : Offset from UTC as +-HH:mm, +-HHmm, or Z (+12:00)Condition:Is validExpression:YearExpression:Month ( 0..11 )Expression:DateExpression:DayExpression:QuarterExpression:HoursExpression:MinutesExpression:SecondsExpression:MillisecondsExpression:UnixTimestampExpression:Format, ISO 8601 format
Expression:Format(format)
Year
YY : 70 71 ... 29 30YYYY : 1970 1971 ... 2029 2030Y : 1970 1971 ... 9999 +10000 +10001Month
M : 1 2 ... 11 12Mo : 1st 2nd ... 11th 12thMM : 01 02 ... 11 12MMM : Jan Feb ... Nov DecMMMM : January February ... November DecemberDay
Day of Month
D : 1 2 ... 30 31Do : 1st 2nd ... 30th 31stDD : 01 02 ... 30 31Day of Year
DDD : 1 2 ... 364 365DDDo : 1st 2nd ... 364th 365thDDDD : 001 002 ... 364 365Day of Week
d : 0 1 ... 5 6do : 0th 1st ... 5th 6thdd : Su Mo ... Fr Saddd : Sun Mon ... Fri Satdddd : Sunday Monday ... Friday SaturdayDay of Week (Locale)
e : 0 1 ... 5 6Day of Week (ISO)
E : 1 2 ... 6 7AM/PM
A : AM PMa : am pmHour
H : 0 1 ... 22 23HH : 00 01 ... 22 23h : 1 2 ... 11 12hh : 01 02 ... 11 12k : 1 2 ... 23 24kk : 01 02 ... 23 24Minute
m : 0 1 ... 58 59mm : 00 01 ... 58 59Second
s : 0 1 ... 58 59ss : 00 01 ... 58 59Fractional Second
S : 0 1 ... 8 9SS : 00 01 ... 98 99SSS : 000 001 ... 998 999SSSS ... SSSSSSSSS : 000[0..] 001[0..] ... 998[0..] 999[0..]Unix Timestamp
X : 1360013296, in secondsx : 1360013296123, in millisecondQuarter
Q : 1 2 3 4Qo : 1st 2nd 3rd 4thWeek
Week of Year
w : 1 2 ... 52 53wo : 1st 2nd ... 52nd 53rdww : 01 02 ... 52 53Week of Year (ISO)
W : 1 2 ... 52 53Wo : 1st 2nd ... 52nd 53rdWW : 01 02 ... 52 53Week Year
gg : 70 71 ... 29 30gggg : 1970 1971 ... 2029 2030Week Year (ISO)
GG : 70 71 ... 29 30GGGG : 1970 1971 ... 2029 2030Localized formats
LT : 8:30 PMLTS : 8:30:25 PML  : 09/04/1986l : 9/4/1986LL : September 4 1986 ll : Sep 4 1986LLL : September 4 1986 8:30 PMlll : Sep 4 1986 8:30 PMLLLL : Thursday, September 4 1986 8:30 PMllll : Thu, Sep 4 1986 8:30 PM[...] : escaping characters. For example, [today] dddd
Action:Set locale, to set display language  (Sample capx)
Action:Add to, to add years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds to current date valueExpression:ElapsedYears( prevDate ), (curDate - prevDate) in yearsExpression:ElapsedMonths( prevDate ), (curDate - prevDate) in monthsExpression:ElapsedDays( prevDate ), (curDate - prevDate) in daysExpression:ElapsedHours( prevDate ), (curDate - prevDate) in hoursExpression:ElapsedMinutes( prevDate ), (curDate - prevDate) in minutesExpression:ElapsedSeconds( prevDate ), (curDate - prevDate) in secondsExpression:ElapsedMilliseconds( prevDate ), (curDate - prevDate) in millisecondsParameter prevDate
Add 1 at 2nd parameter to return float number. For example Expression:ElapsedYears( prevDate , 1 )
Start date time
Expression:StartOfYearExpression:StartOfMonthExpression:StartOfQuarterExpression:StartOfWeekExpression:StartOfISOWeekExpression:StartOfDateExpression:StartOfHourExpression:StartOfMinuteExpression:StartOfSecondEnd date time
Expression:EndOfYearExpression:EndOfMonthExpression:EndOfQuarterExpression:EndOfWeekExpression:EndOfISOWeekExpression:EndOfDateExpression:EndOfHourExpression:EndOfMinuteExpression:EndOfSecondEach expression returns unix timestamp or date string
Expression:StartOfYear, returns unix timestampExpression:StartOfYear( "iso" ), returns ISO date stringExpression:StartOfYear( format ), returns formatted date string