[erlang-questions] strftime for formatting dates and times

Kenny Stone <>
Tue Jun 21 17:26:53 CEST 2011


https://github.com/kennystone/strftimerl

I literally copied ruby's strftime docs into the readme and implemented
(almost) each type of formatting.

I'm considering patching the calendar module with this functionality.
 Thoughts?

strftime:f(now(), "Printed on %m/%d/%Y").    %=> "Printed on 11/19/2007"
strftime:f(now(), "at %I:%M%p").             %=> "at 08:37AM"
strftime:f(now(), "at %I:%M%p", universal).  %=> "at 02:37PM"
strftime:f(now(), "%D-%T.%N").               %=>
"11/19/2007-08:38:02.445443"

-Kenny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110621/5655231b/attachment.html>


More information about the erlang-questions mailing list