suve

awful: function: dt-decode

Declaration

dict :dt-decode ( float $DATETIME )

Summary

Returns a dictionary containing information about the provided DateTime value.

Index Value
y Year
m Month (1 - 12)
d Day (1 - 31)
w Day of week (1 for Monday, 7 for Sunday)
h Hour (0-23)
i Minute (0-59)
s Second (0-59)
z Millisecond (0-999)

Example

# :dt-decode example
!fun :myDate $dt
   :set &D :dt-decode $dt
   :return :str-write $D[s'y'] s'/' $D[s'm'] $D[s'd'] s'/' $D[s'h'] $D[s'i']
!nuf

:set &DateTime :dt-now
:writeln :dt-str s'Y/md/hi' $DateTime
:writeln :myDate $DateTime

wikipage modified on 2014/0601/2317