Difference between revisions of "Today to string"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(r8942 & r8944 adds time_to_string() and now_to_string())
imported>Fxer
m (Clarifying what this function does, add note how it is calculated)
 
(One intermediate revision by one other user not shown)
Line 13: Line 13:
 
}}|
 
}}|
  
function_description=Returns the current date (based on your local computer's system settings) in an ISO basic format (YYYYMMDD).|
+
function_description=Returns the current real-world date corresponding to the KoL game date, where rollover is the start of a new day, in an ISO basic format (YYYYMMDD).|
  
 
needscode=yes|
 
needscode=yes|
Line 19: Line 19:
 
more_info=See this [http://en.wikipedia.org/wiki/ISO_8601 wikipedia article] for more information.|
 
more_info=See this [http://en.wikipedia.org/wiki/ISO_8601 wikipedia article] for more information.|
 
}}
 
}}
 +
 +
== Notes ==
 +
The value returned is calculated from timezone GMT-3:30. Since rollover occurs at 8:30pm MST (UTC 3:30) this makes rollover occur at "midnight." Changing your local system time affects which day mafia thinks it is, but "midnight" will always be pinned to rollover.
 +
 
{{SeeAlso|gameday_to_string|gameday_to_int|time_to_string|now_to_string}}
 
{{SeeAlso|gameday_to_string|gameday_to_int|time_to_string|now_to_string}}
[[Category:String Handling Routines]]
+
 
 +
[[Category:Miscellaneous Functions]]

Latest revision as of 17:29, 2 June 2016

needs(code_samples);

Function Syntax

string today_to_string()

Returns the current real-world date corresponding to the KoL game date, where rollover is the start of a new day, in an ISO basic format (YYYYMMDD).

More Information

See this wikipedia article for more information.


Notes

The value returned is calculated from timezone GMT-3:30. Since rollover occurs at 8:30pm MST (UTC 3:30) this makes rollover occur at "midnight." Changing your local system time affects which day mafia thinks it is, but "midnight" will always be pinned to rollover.

See Also

gameday_to_string() | gameday_to_int() | time_to_string() | now_to_string()