From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.devel Subject: Re: What do I use if not `float-time'? Date: Wed, 6 Jan 2010 21:40:53 +0100 Message-ID: <7b501d5c1001061240s5076734cib932061058b237cb@mail.gmail.com> References: <7b501d5c1001060715j6a9bf132y93d6c55d5af4c511@mail.gmail.com> <41805.130.55.118.19.1262791780.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262810645 31728 80.91.229.12 (6 Jan 2010 20:44:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Jan 2010 20:44:05 +0000 (UTC) Cc: Emacs-Devel devel To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 06 21:43:58 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NScjV-0005DR-13 for ged-emacs-devel@m.gmane.org; Wed, 06 Jan 2010 21:43:57 +0100 Original-Received: from localhost ([127.0.0.1]:51327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NScjV-00008e-IT for ged-emacs-devel@m.gmane.org; Wed, 06 Jan 2010 15:43:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSch4-00062g-6i for emacs-devel@gnu.org; Wed, 06 Jan 2010 15:41:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NScgz-0005xR-5O for emacs-devel@gnu.org; Wed, 06 Jan 2010 15:41:25 -0500 Original-Received: from [199.232.76.173] (port=37189 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NScgy-0005xG-Ud for emacs-devel@gnu.org; Wed, 06 Jan 2010 15:41:21 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:29964) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NScgy-0006TS-JN for emacs-devel@gnu.org; Wed, 06 Jan 2010 15:41:20 -0500 Original-Received: from mail-ew0-f224.google.com ([209.85.219.224]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NScgt-0000eI-F0 for emacs-devel@gnu.org; Wed, 06 Jan 2010 15:41:15 -0500 Original-Received: by ewy24 with SMTP id 24so20832068ewy.26 for ; Wed, 06 Jan 2010 12:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=peYEySL2Pvk/WpVd6AL6RmNvEyb0z74c9eqSwF6IGpI=; b=T7A03fdGeJpsBRjhgbenJauzyenJg+FPeGV7qz4iws5kgGTLQ4f+nlb3cD9ApfnlfV crIQzofNsJk9G9bIYGGxVrQBP/yHnIc9Df9ZBPlNAyyItLGFSDXM5pgITxK6UmFXLWa0 Ochmaj+8vVf/qdb3I2wPwW5P/oCLNnWBhfSsU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=D9aITq0azwOaaFxIofGVUc6KsM5w8AOaTfp8Q56LSb14vmSvNP9+p9dxUd1Yn5RmGu S4a4fsdD6NBG0xDquz5uRWzm8a/ANJa8skc9g9+sycSyii8LWpkdlie98SEdDMWwIK9g /+kjp163BTdy5MIyDa3/ozKd0v146JIS3BRZY= Original-Received: by 10.213.25.79 with SMTP id y15mr5535522ebb.78.1262810473208; Wed, 06 Jan 2010 12:41:13 -0800 (PST) In-Reply-To: <41805.130.55.118.19.1262791780.squirrel@webmail.lanl.gov> X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:119546 Archived-At: 2010/1/6 Davis Herring : >> Okay, so what do I use instead? I just want a "UNIX timestamp" as an >> integer or string. What's the idiomatic way to get that? > > Use `current-time'. =A0The trick is that you then have to deal with multi= ple > integers (because Emacs ints are (often) shorter than 32 bits). > `float-time' exists to avoid that inconvenience at the cost of another. > In practice, using the integer parts of calls to (float-time) should be > fine so long as you don't do too much arithmetic on them: doubles have 53 > bits of mantissa, and so can represent any reasonable traditional > (integer) time stamp exactly. > > To get a string version of the integer part (which you can't safely turn > into an integer!), you can just use (format-time-string "%s"). > Thanks, the `format-time-string' trick works like a charm. I actually needed a string in the first place, so that was perfect. --=20 Deniz Dogan