[erlang-questions] parsing dates

Steve Strong steve@REDACTED
Wed Dec 14 22:20:48 CET 2011


I use something like: 

    <<Year:4/binary,"-",
      Month:2/binary,"-",
      Day:2/binary,"T",
      Hour:2/binary,":",
      Minute:2/binary,":",
      Second:2/binary,
      _Rem/binary>> = list_to_binary(Date)


from there, it's trivial to return a datetime() tuple.

Cheers,

Steve 

-- Steve Strong
@srstrong

Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Wednesday, 14 December 2011 at 22:18, Joel Reymont wrote:

> Is there a function somewhere to parse a date like this: 
> 
> 2008-06-30T00:00:00.000Z
> 
> Thanks, Joel 
> 
> ---
> Hardcore embedded Linux development
> http://www.linkedin.com/in/joelreymont
> Device drivers, firmware and debugging
> 
> 
> 
> 
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED (mailto: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/20111214/bde686d7/attachment.htm>


More information about the erlang-questions mailing list