[erlang-questions] timestamp conversion
Sat Apr 16 01:15:30 CEST 2011
I've not exhaustively tested this but a direct comparison of the list
(though I prefer binary text representations for a whole raft of
reasons)... should work for you.
e.g. given the string format (esp. length) is known to be exactly the
L1 = "2011-04-15T23:00:48Z"
L2 = "2011-04-15T23:00:53Z"
4> L1 < L2.
5> L1 > L2.
On Apr 15, 5:13 pm, "Peter W. Morreale" <pmorre...@REDACTED> wrote:
> This may be embarrassingly simple, but I am struggling with it...
> I need compare string timestamps for dealing with expiration. In some
> cases it may another string timestamp, in others it will be against the
> current time.
> The string timestamps will always have the format:
> I think I want to convert to integer seconds, however even then its not
> clear to me how to perform the comparison, although I think this is a
> case for using the "if" expression.
> Please be gentle, I'm still new to Erlang.
> Thanks much
> erlang-questions mailing list
More information about the erlang-questions