Skip to content
Reference > Methods

datePartNum(unixEpochMillis,part,timezone)

Definition

Integer datePartNum(Number unixEpochMillis, String part, String timezone)

Description

Converts a datetime to an Integer. Returns an Integer that is the number of milliseconds since 1/1/1970 in UTC timezone.

Parameter Definition

Name Type Description
unixEpochMillis Number Number of milliseconds since 1/1/1970 in UTC timezone
part String Field to return: y-year, M-month, d-day of month,,E-day of week,D-day of year,H-hour,m-minute,s-Second,S-millisecond,q-quarter,w-week in year,W-week in month,F-day of week in month
timezone String TimeZone to return extracted fields in

Examples

1
2
3
Integer r1 = datePartNum(100000000,"y","EST5EDT"); // r1 == 1970
Object r2 = datePartNum(100000000,"HmsS","UTC"); // r2 == null
Integer r3 = datePartNum(100000000,"E","UTC"); // r3 == 6