cl-json
cl-json copied to clipboard
cl-json:encode-json of local-time not useful
(cl-json:encode-json (local-time:now))
{"day":8845,"sec":63958,"nsec":58418000}
This encoding a Lisp timestamp is rarely useful outside of CL. Encoding as a unix timestamp would be more useful:
(defmethod cl-json:encode-json ((tstamp LOCAL-TIME:TIMESTAMP) &optional (stream t))
"Encode timestamps as unix timestamps in json."
(format stream "~A" (local-time:timestamp-to-unix tstamp)))