[erlang-questions] formatting timestamps

Chris Hicks silent_vendetta@REDACTED
Mon Jun 13 18:47:57 CEST 2011


You're just going to have to do it yourself:
{{Year, Month, Day}, {Hour, Minute, Second}} = erlang:universaltime(), %% Or erlang:localtime()Y = erlang:integer_to_list(Year),...Formatted_date = lists:concat([Y, "-", Mo, "-", D, " ", H, ":", Mi, ":", S, ".", Whatever_else_here]),...
Not saying that is the most efficient way to do it but it would get you what you are looking for.
Chris Hicks.

> From: joelr1@REDACTED
> Date: Mon, 13 Jun 2011 20:30:11 +0400
> To: qrilka@REDACTED
> CC: erlang-questions@REDACTED
> Subject: Re: [erlang-questions] formatting timestamps
> 
> 
> 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
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110613/d12c0902/attachment.htm>


More information about the erlang-questions mailing list