- Reference
- Script reference
- Timing and scheduling
mktime
Convert time and date into Unixtime value
Description#
mktime(year, month, day, hour, minute, second, [local])The date and time will be converted into a Unixtime value (seconds since UTC 1970-01-01).
By default (of local is false/zero or not included), the date is handled as UTC. If local is true, the local timezone is considered.
Parameters#
year | Year input |
month | Month input |
day | Day of month input |
hour | Hour input |
minute | Minute input |
second | Minute input |
[local] | Set to true/1 if input is in local timezeone (optional, default=UTC/false) |
Return value#
Returns the number of seconds since 1970-01-01 00:00:00 (UTC)
Example usage#
new utcIndependenceDay;
utcIndependenceDay = mktime(2022, 7, 4, 12, 0, 0); // returns 1656936000
NOTE: First appeared in firmware 22110901
Last updated Nov 9, 2022