eLabSDK2.DateUtilities.Date
Hierarchy
-
default
↳
Date
Methods
userDateTimeToUTC
Static
userDateTimeToUTC(dateTime
, format
, timezone
): string
Convert a datetime using the given timezone and format to UTC.
Parameters
Name | Type | Description |
---|---|---|
dateTime | string | a datetime object like 1985-10-26T22:00:00Z |
format | string | a momentjs compatible dateformat; see docs |
timezone | string | The users timezone according to the IANA timezone database (e.g. Europe/Amsterdam) |
Returns
string
a formatted UTC datetime.
userDateToUTC
Static
userDateToUTC(date
, format?
, timezone
): string
Convert a date using the given format to UTC.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
date | string | undefined | a date object to format like '1985-10-26' |
format | string | 'yyyy-mm-dd' | a momentjs compatible dateformat; see docs |
timezone | string | undefined | The users timezone according to the IANA timezone database (e.g. Europe/Amsterdam) |
Returns
string
a formatted UTC date.
© 2023 eLabNext
Updated 17 days ago