Timestamp to date: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
Gausie (talk | contribs)
Created page with "{{ #vardefine:name|timestamp_to_date}}{{ #vardefine:return_type|string}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={{#var:name}}| aggregate={{#var:aggre..."
 
m int timestamp comes first, outformat second (https://github.com/loathers/kolmafia-js/blob/main/index.d.ts)
 
Line 11: Line 11:
return_type={{#var:return_type}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
return_also={{#var:return_also}}|
parameter2={{Param|int|timestamp}}|
parameter1={{Param|int|timestamp}}|
parameter1={{Param|string|outFormat}}|
parameter2={{Param|string|outFormat}}|
p2desc={{pspan|dtg}} is the timestamp to convert.|
p2desc={{pspan|dtg}} is the timestamp to convert.|
p1desc={{pspan|inFormat}} is how the output string is formatted.|
p1desc={{pspan|inFormat}} is how the output string is formatted.|

Latest revision as of 21:57, 19 July 2025

Function Syntax

string timestamp_to_date(int timestamp ,string outFormat )

  • inFormat is how the output string is formatted.
  • dtg is the timestamp to convert.

Converts a UNIX timestamp (in milliseconds) to a date. Full information on SimpleDateFormat here.


See Also

gameday_to_string() | gameday_to_int() | now_to_string() | now_to_int() | time_to_string() | date_to_timestamp()