From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xavier Maillard Newsgroups: gmane.emacs.help Subject: [SOLVED] Re: Timestamps and php Date: Sun, 15 Nov 2009 09:58:53 +0100 Organization: GNU's Not UNIX! Message-ID: <200911150858.nAF8wrkU017499@fed.local> References: <200911150024.nAF0Oco8013304@fed.local> <20091115061402.GA14534@tomas> Reply-To: Xavier Maillard NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1258275547 18288 80.91.229.12 (15 Nov 2009 08:59:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Nov 2009 08:59:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 15 09:59:00 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N9awk-0007Ek-5R for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Nov 2009 09:58:58 +0100 Original-Received: from localhost ([127.0.0.1]:47860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9awj-0000Am-JW for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Nov 2009 03:58:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9awN-00009c-ME for help-gnu-emacs@gnu.org; Sun, 15 Nov 2009 03:58:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9awJ-00007b-EJ for help-gnu-emacs@gnu.org; Sun, 15 Nov 2009 03:58:35 -0500 Original-Received: from [199.232.76.173] (port=40174 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9awJ-00007S-1k for help-gnu-emacs@gnu.org; Sun, 15 Nov 2009 03:58:31 -0500 Original-Received: from out4.smtp.messagingengine.com ([66.111.4.28]:34483) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9awI-0007ZM-JH for help-gnu-emacs@gnu.org; Sun, 15 Nov 2009 03:58:30 -0500 Original-Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 49891BE9C0; Sun, 15 Nov 2009 03:58:30 -0500 (EST) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 15 Nov 2009 03:58:30 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:message-id:from:to:cc:in-reply-to:subject:reply-to:references; s=smtpout; bh=ZfOBc55SlqLp8/jrfJ+jI6ZZL8A=; b=mysywRBM6z4u7eXY1RcKrVdEU66R/5DAxle1ErYYeDvaQs2ZQpktSyS2Kcocbvn9NTnwS0OjnHtUYqtRSv+0E25/RRkejrO0+GdyAQshGSoUpOxwTt9536DfwxOrCk0ANtlS5TfQBYT5oDy1Ys5YLboEb0eDyICLHOuTear9QpA= X-Sasl-enc: 5pcZLlLK1guIqNqKXdBj4pp3ZPwx8rw2/vvdaNrwii9W 1258275509 Original-Received: from fed.local (cha51-2-82-244-211-40.fbx.proxad.net [82.244.211.40]) by mail.messagingengine.com (Postfix) with ESMTPSA id CA8EF8D96; Sun, 15 Nov 2009 03:58:29 -0500 (EST) Original-Received: from fed.local (fed.local [127.0.0.1]) by fed.local (8.14.3/8.14.3) with ESMTP id nAF8wsmK017503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 Nov 2009 09:58:54 +0100 Original-Received: (from xavier@localhost) by fed.local (8.14.3/8.14.3/Submit) id nAF8wrkU017499; Sun, 15 Nov 2009 09:58:53 +0100 X-Authentication-Warning: fed.local: xavier set sender to xma@gnu.org using -f In-reply-to: <20091115061402.GA14534@tomas> User-Agent: Rmail GNU emacs 23.1 on cat: /etc/slackware-version: No such file or directory Jabber-ID: xavier@maillard.im X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69753 Archived-At: 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