[erlang-questions] formatting timestamps

Kenny Stone <>
Mon Jun 13 18:46:26 CEST 2011


Date times are always frustrating in erlang.

I think this will get you all the data you need...

Now = now().
{{Year,Mon,Day},{Hour,Min,Sec}} = calendar:now_to_universal_time(Now).
{_,_,MicroSec} = Now.

Then you wrangle it into a string with io_lib:
http://erlang.org/pipermail/erlang-questions/2010-October/054132.html

ugly... maybe there's a better way


On Mon, Jun 13, 2011 at 11:30 AM, Joel Reymont <> wrote:

>
> On Jun 13, 2011, at 8:08 PM, Kirill Zaborsky wrote:
>
> > Maybe https://github.com/daleharvey/dh_date will do the trick?
>
> I don't think so, e.g.
>
> %% This module formats erlang dates in the form
> %% {{Year, Month, Day}, {Hour, Minute, Second}}
>
> --------------------------------------------------------------------------
> - for hire: mac osx device driver ninja, kernel extensions and usb drivers
> ---------------------+------------+---------------------------------------
> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
> ---------------------+------------+---------------------------------------
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110613/996e8c62/attachment.html>


More information about the erlang-questions mailing list