User Tools

Site Tools


uphp:functions:settime

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:settime [2017/05/08 14:35]
jeff
uphp:functions:settime [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>
  
-<html>Set the system time from a Linux <b><span style="color:blue">timestamp<span style="color:black"></b>, with optional <b><span style="color:blue">calibration</b></html>+<html>Set the system time from a Linux <b><span style="color:blue">Timestamp<span style="color:black"></b>, with optional <b><span style="color:blue">calibration</b></html>
  
 ====Description==== ====Description====
  
-<well size="sm"> +<well size="sm"><html>
-<html>+
 <span style="font-size:125%">settime ( <span style="font-size:125%">settime (
 <span style="color:green">int <span style="color:green">int
Line 16: Line 15:
 <span style="color:blue">$calibration <span style="color:blue">$calibration
 <span style="color:black">] ) <span style="color:black">] )
-</html> +</html></well>
-</well>+
  
-<html>This function will modify the system clock from a <b><span style="color:blue">timestamp<span style="color:black"></b> If the optional <b><span style="color:blue">calibration</b></html> constant is included it will also modify the RTC register value to increase the time somewhat to compensate for clock lag.</html>+<html>This function will modify the system clock from a <b><span style="color:blue">timestamp<span style="color:black"></b> If the optional <b><span style="color:blue">calibration</b> constant is included it will also modify the RTC register value to increase the time somewhat to compensate for clock lag.</html>
  
 ====Parameters==== ====Parameters====
Line 27: Line 25:
 <html><b><span style="color:blue">$calibration<span style="color:black"></b></html>:  Optional, value to set in the <tooltip title="Real Time Clock">RTC</tooltip> calibration register((The calibration register value is also stored in ''/config/time.ini'' key ''rtc_adjust''.)) <html><b><span style="color:blue">$calibration<span style="color:black"></b></html>:  Optional, value to set in the <tooltip title="Real Time Clock">RTC</tooltip> calibration register((The calibration register value is also stored in ''/config/time.ini'' key ''rtc_adjust''.))
  
-====Return Value====+====Return Values====
  
 None None
Line 33: Line 31:
 ====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 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''.)+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''.)
  
 ====See Also==== ====See Also====
  
-[[microtime()]] - Return number of milliseconds since boot+[[microtime()]] - Return the number of milliseconds since boot
  
-[[mktime()]] - Return Linux timestamp for a given date and time+[[mktime()]] - Return the Linux Timestamp for a given date and time
  
-[[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/settime.1494254153.txt.gz · Last modified: 2021/09/13 05:56 (external edit)