User Tools

Site Tools


uphp:functions:mktime

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:mktime [2017/05/06 13:14]
jeff
uphp:functions:mktime [2021/09/13 05:57] (current)
Line 3: Line 3:
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Return Linux timestamp for a given date and time+Return the Linux Timestamp for a given date and time
  
 ====Description==== ====Description====
  
-<well size="sm"> +<well size="sm"><html>
-<html>+
 <span style="font-size:125%;color:green">int <span style="font-size:125%;color:green">int
-<span style="color:black"> +<span style="color:black">mktime (
-</html> +
-[[mktime]] ( +
-<html>+
 <span style="color:green">int <span style="color:green">int
-<span style="color:blue">$hr<span style="color:black">,+<span style="color:blue">$hour<span style="color:black">,
 <span style="color:green">int <span style="color:green">int
-<span style="color:blue">$min<span style="color:black">,+<span style="color:blue">$minute<span style="color:black">,
 <span style="color:green">int <span style="color:green">int
-<span style="color:blue">$sec<span style="color:black">,+<span style="color:blue">$second<span style="color:black">,
 <span style="color:green">int <span style="color:green">int
-<span style="color:blue">$mon<span style="color:black">,+<span style="color:blue">$month<span style="color:black">,
 <span style="color:green">int <span style="color:green">int
 <span style="color:blue">$day<span style="color:black">, <span style="color:blue">$day<span style="color:black">,
 <span style="color:green">int <span style="color:green">int
-<span style="color:blue">$yr+<span style="color:blue">$year
 <span style="color:black">) <span style="color:black">)
-</html> +</html></well>
-</well>+
  
 ====Parameters==== ====Parameters====
  
-<html><b><span style="color:blue">$hr<span style="color:black"></b></html>:  Hour 0-23+<html><b><span style="color:blue">$hour<span style="color:black"></b></html>:  Hour 0-23
  
-<html><b><span style="color:blue">$min<span style="color:black"></b></html>:  Minutes 0-59+<html><b><span style="color:blue">$minute<span style="color:black"></b></html>:  Minutes 0-59
  
-<html><b><span style="color:blue">$sec<span style="color:black"></b></html>:  Seconds 0-59+<html><b><span style="color:blue">$second<span style="color:black"></b></html>:  Seconds 0-59
  
-<html><b><span style="color:blue">$mon<span style="color:black"></b></html>:  Month 1-12+<html><b><span style="color:blue">$month<span style="color:black"></b></html>:  Month 0-11
  
 <html><b><span style="color:blue">$day<span style="color:black"></b></html>:  Day 1-31 (depending on the month) <html><b><span style="color:blue">$day<span style="color:black"></b></html>:  Day 1-31 (depending on the month)
  
-<html><b><span style="color:blue">$yr<span style="color:black"></b></html>:  Year, four digit representation+<html><b><span style="color:blue">$year<span style="color:black"></b></html>:  Year, four digit representation
  
-====Return Value====+====Return Values====
  
 <html><b><span style="color:green">Integer<span style="color:black"></b></html>:  Seconds since January 1, 1970, 00:00:00, local Wattmon time <html><b><span style="color:green">Integer<span style="color:black"></b></html>:  Seconds since January 1, 1970, 00:00:00, local Wattmon time
Line 50: Line 45:
 ====Notes==== ====Notes====
  
-Unlike mainline PHP, in uPHP "Linux timestamps" are based upon the Wattmon's local time, not UTC/GMT.+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//.+Technically, the Unix Epoch is defined as being January 1, 1970, 00:00:00 //GMT//. But on the [[hardware:wattmons|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. 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 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''.)+In other words:  Wattmon "Linux Timestamps" are based upon local Wattmon time and are not adjusted by the timezone setting in Control Panel > Time Settings (Time and Date Settings) > UTC Offset.  (These settings are stored in ''/config/time.ini''.) 
 + 
 +====Note==== 
 +This differs from the traditional PHP implementation in that the month variable is 0-11 rather than 1-12.  This was due to an early implementation error which we are unable to modify now since too many devices use the code.
  
 ====See Also==== ====See Also====
  
-[[microtime()]] - Return number of milliseconds since boot+[[microtime()]] - Return the number of milliseconds since boot
  
-[[settime()]] - Set the system time from a Linux timestamp+[[settime()]] - Set the system time from a Linux Timestamp, with optional calibration
  
-[[strftime()]] - Format a Linux timestamp using a format <html><b><span style="color:green">string</b></html>+[[strftime()]] - Format a Linux Timestamp using a format <html><b><span style="color:green">string</b></html>
  
-[[time()]] - Return current system timestamp+[[time()]] - Return the current system timestamp
  
-[[timefromfat()]] - Convert a FAT filetime to a Linux timestamp+[[timefromfat()]] - Convert a FAT filetime to a Linux Timestamp
  
-[[uptime()]] - Return uptime in milliseconds+[[uptime()]] - Return the uptime in milliseconds
  
uphp/functions/mktime.1494076470.txt.gz · Last modified: 2021/09/13 05:56 (external edit)