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

NameTypeDescription
dateTimestringa datetime object like 1985-10-26T22:00:00Z
formatstringa momentjs compatible dateformat; see docs
timezonestringThe users timezone according to the IANA timezone database (e.g. Europe/Amsterdam)

Returns

string

a formatted UTC datetime.


userDateToUTC

Static userDateToUTC(date, format?): string

Convert a date using the given format to UTC.

Parameters

NameTypeDefault valueDescription
datestringundefineda date object to format like '1985-10-26'
formatstring'yyyy-mm-dd'a momentjs compatible dateformat; see docs

Returns

string

a formatted UTC date.


© 2023 eLabNext