[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Timestamps and php
From: |
tomas |
Subject: |
Re: Timestamps and php |
Date: |
Sun, 15 Nov 2009 07:14:02 +0100 |
User-agent: |
Mutt/1.5.15+20070412 (2007-04-11) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, Nov 15, 2009 at 01:24:38AM +0100, Xavier Maillard wrote:
> Hi,
>
> Using a XML-RPC call, I am returned this information:
>
> :datetime (19198 34091)
>
> I'd like this to be transformed in something I can read. I know
> encode/decode functions but I don't know how I can display the
> result using format-time-string. Any idea ?
(format-time-string "%Y-%m-%d %H:%M:%S" (current-time) t)
=> "2009-11-15 06:14:49"
[That's in UTC -- see the function doc for tons and tons of options]
> While at it, how can I convert a date into a "PHP timestamp"
> which, as far as I know, looks like 1258190619.0.
Whatever a "PHP timestamp" may be, but it looks a lot like the number of
seconds since the Epoch. You might give the function float-time a try.
Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFK/5wqBcgs9XrR2kYRApICAJ9b38WttJKlbwEVoUO/+3lHF9hTPwCfTCu9
wMMpCzmoDHvkophyyhX7QqI=
=tAfM
-----END PGP SIGNATURE-----