User Tools

Site Tools


uphp:functions:mktime

This is an old revision of the document!


mktime

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Return Linux timestamp for a given date and time

Description

int mktime ( int $h, int $m, int $s, int $m, int $d, int $y )

Parameters

$h: Hour 0-23

$m: Minutes 0-59

$s: Seconds 0-59

$m: Month 1-12

$d: Day 1-31 (depending on the month)

$y: Year, four digit representation

Return Value

Integer: Seconds since January 1, 1970, 00:00:00, local Wattmon time

Notes

Unlike mainline PHP, in uPHP “Linux timestamps” are based upon the Wattmon's local time, not UTC/GMT.

Technically, the Unix Epoch is defined as being January 1, 1970, 00:00:00 GMT. But on the Wattmon, timestamps are relative to January 1, 1970, 00:00:00 local timezone.

If the Wattmon clock and timezone are set to UTC+00 (GMT) then the uPHP timestamp is the same as mainline PHP, otherwise not.

In uPHP on the Wattmon this simplification is referred to as a “Linux timestamp” but it should be noted that it may not be exactly the same, depending on the Wattmon's timezone settings.

In other words: Wattmon “Linux timestamps” are based upon local Wattmon time and do not consider the timezone setting in Control Panel > Time Settings (Time and Date Settings) > UTC Offset. (These settings are stored in /config/time.ini.)

See Also

microtime() - Return number of milliseconds since boot

settime() - Set the system time from a Linux timestamp

strftime() - Format a Linux timestamp using a format string

time() - Return current system timestamp

timefromfat() - Convert a FAT filetime to a Linux timestamp

uptime() - Return uptime in milliseconds

uphp/functions/mktime.1494073999.txt.gz · Last modified: 2021/09/13 05:56 (external edit)