help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] Re: Timestamps and php


From: Xavier Maillard
Subject: [SOLVED] Re: Timestamps and php
Date: Sun, 15 Nov 2009 09:58:53 +0100
User-agent: Rmail GNU emacs 23.1 on cat: /etc/slackware-version: No such file or directory

Hi,

   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"

I know why I was into trouble, I passed a decoded time (via
decode-time) which gave weird results. I did not read the
docstring carefully...

   [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.

I did not notice this function before. Thank you very much !

        Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]