right time by 51b

-module(r).
-export([m/0]).
m()->case io:fread('',"~d")of{_,[X]}->{{Y,M,D},{H,L,S}}=calendar:now_to_datetime({0,X-length([1||Y<-"\x03\x03\x04\x05\x06\x07\x08\x09\n\x0b\x0c\x0d\x0f\x11\x14\x14\x16\x18\x18\x1a\x1b\x1d$",X div 31556926>=Y]),0}),io:format("~p-~2..0B-~2..0b ~.2.0w:~.2.0w:~.2.0w\n",[Y,M,D,H,L,S]),m();_->0end.

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page