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

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

Comparing epoch times


From: Balaji Venkataraman
Subject: Comparing epoch times
Date: Fri, 24 Jun 2005 14:17:18 -0700
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Hello,

I'm trying to compare two timestamps (from different sources).

(let ((fetchtime (match-string 2))
      (mtime (nth 5 (file-attributes file))))
      (cond ((= (float-time mtime) fetchtime)
             (...blah blah...do something)
             etc. etc.)))

'fetchtime' is a string (from a regexp match) which has the epoch-time. I
also obtain the file timestamp from file-attributes. I convert this to
epoch-time and try to compare. Problem is that 'fetchtime' is a string. So
trying to convert them to the same data types was what I'm trying. The
problem is most built in functions seem to hit a limit when converting
between various datatypes. Pick a large enough number and try.

Other variations I tried:
(= (string-to-int (concat (number-to-string 1109546122) ".0")) (float-time 
'(16930 21642)))

Any help appreciated. Thanks.

Balaji

-- 
Remember 2 + 2 = 5, for large values of 2


reply via email to

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