../
kernel
functions
add
all
apply_delta
assert
atan2
btn
btnp
camera
cd
char
chooser
circ
circfill
clip
cls
color
cos
count
cp
create_delta
create_gui
create_process
cursor
date
del
deli
env
error
exit
fetch
fetch_metadata
fget
fillp
foreach
fset
fstat
fullpath
get_clipboard
get_display
get_draw_target
get_spr
include
input
key
keyp
line
ls
map
max
memcpy
memmap
memset
menuitem
mget
mkdir
mouse
mouselock
mset
music
mv
note
on_event
open
oval
ovalfill
peek
peek2
peek4
peek8
peektext
pget
pid
pod
poke
poke2
poke4
poke8
printh
pset
pwd
readtext
rect
rectfill
rm
rrect
rrectfill
scoresub
send_message
set_clipboard
set_draw_target
set_spr
sfx
sin
socket
split
spr
sspr
stat
stop
store
store_metadata
sub
time
tokenoid
type
unmap
unpod
userdata
vec
vid
window
date([format],[t],[delta]): string
Overview
Returns the current day and time formatted using Lua's standard date strings.
Arguments
[format]: string
The output string format; defaults to "!%Y-%m-%d %H:%M:%S" (UTC).
Picotron timestamps use this default format.
[t]: string|number
The moment in time to be encoded in a string; defaults to the current time.
When a string: the date in format "!%Y-%m-%d %H:%M:%S" (UTC)
When an integer: the epoch timestamp
[delta]: number
The amount of seconds to add to [t]
Returns
date: string
The date requested in the requested format
Examples
Sourced from the Picotron Manual
Show the current UTC time (use this for timestamps)
?date()
Show the current local time
?date("%Y-%m-%d %H:%M:%S")
convert a UTC date to local time
?date("%Y-%m-%d %H:%M:%S", "2024-03-14 03:14:00")
local time 1 hour ago
?date("%Y-%m-%d %H:%M:%S", nil, -60*60)