![]() |
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns the date for a specified amount of time since the UNIX epoch for the OS time zone.
date = C_DateAndTime.GetCalendarTimeFromEpoch(epoch)
Arguments[]
- epoch
- number - time in microseconds
Returns[]
- date
- CalendarTime
| Field | Type | Description |
|---|---|---|
| year | number | The current year (e.g. 2019) |
| month | number | The current month [1-12] |
| monthDay | number | The current day of the month [1-31] |
| weekday | number | The current day of the week (1=Sunday, 2=Monday, ..., 7=Saturday) |
| hour | number | The current time in hours [0-23] |
| minute | number | The current time in minutes [0-59] |
Example[]
local d = C_DateAndTime.GetCalendarTimeFromEpoch(1e6 * 60 * 60 * 24)
print(format("One day since epoch is %d-%02d-%02d %02d:%02d", d.year, d.month, d.monthDay, d.hour, d.minute))
> One day since epoch is 1970-01-02 01:00
Patch changes[]
Patch 8.1.0 (2018-12-11): Moved to C_DateAndTime.GetCalendarTimeFromEpoch(), the previous alias is deprecated. [1]
Patch 8.0.1 (2018-07-17): Added as C_DateAndTime.GetDateFromEpoch()
