How to format a local timestamp?

Cameron Kerr <>
Sat Oct 3 00:05:14 CEST 2009


I must surely be missing something in the documentation, but I cannot 
find any easy way to generate a human-readable timestamp easily in Erlang.

I would have expected something in the calendar module, but there is 
nothing that returns a string. I've hunted and I found something for 
RFC1123 format in httpd_util, but that is always in GMT, and I would 
much prefer something more familiar to the user (ie. localtime, with or 
without timezone).

Surely there must be a standard function for doing something like 
this... until then, I'll just ~p  calendar:local_time().

Thanks,
Cameron


More information about the erlang-questions mailing list