How to convert string representation of Date and Time to integer in Erlang and vice versa?

Wiger Ulf ulf.wiger@REDACTED
Sat Mar 8 17:30:57 CET 2003


There are some helper functions, but whether they do what you need is another question. That depends on your specific problem.

See the documentation for httpd_util and calendar, for example.
http://www.erlang.org/doc/r9b/lib/inets-3.0/doc/html/httpd_util.html
http://www.erlang.org/doc/r9b/lib/stdlib-1.11.0/doc/html/calendar.html

/Uffe

Erlang (BEAM) emulator version 5.2 [threads:0]

Eshell V5.2  (abort with ^G)
1> httpd_util:rfc1123_date().
"Sat, 08 Mar 2003 16:19:58 GMT"
2> httpd_util:rfc1123_date({{1888,05,17},{08,15,34}}).
"Thu, 17 May 1888 08:15:34 GMT"
3> httpd_util:convert_request_date("Sun Nov  6 08:49:37 1994").
{{1994,11,6},{8,49,37}}
4> calendar:date_to_gregorian_days(date()).
731647
5> calendar:datetime_to_gregorian_seconds({date(),time()}).
63214363500
  ----- Original Message ----- 
  From: Victoria Kulikou 
  To: erlang-questions@REDACTED 
  Sent: den 8 mars 2003 00:17
  Subject: How to convert string representation of Date and Time to integer in Erlang and vice versa?


  Is there a library in Erlang that provides conversion of Date and Time from string to integer and from integer to string?

   

  Sincerely,

  Victoria.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20030308/c70075f7/attachment.htm>


More information about the erlang-questions mailing list