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

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

Re: efficiently viewing Unix timestamps as dates


From: Ted Zlatanov
Subject: Re: efficiently viewing Unix timestamps as dates
Date: Thu, 16 Dec 2010 13:26:05 -0600
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

On Thu, 16 Dec 2010 00:28:38 -0700 Kevin Rodgers <kevin.d.rodgers@gmail.com> 
wrote: 

KR> On 12/13/10 10:20 AM, Ted Zlatanov wrote:
>> Is there a mode to view (not convert!) Unix timestamps as dates?

KR> What is a Unix timestamp, and how is it represented in Emacs Lisp (e.g. a
KR> number or string or some other data type, and in what format)?

It's the number of seconds since the epoch, e.g. 

date '+%s'

or `M-x current-time' if you combine the first two integers, or 
`M-x float-time' if you round it.  Right now that's 1292527019 in
decimal.

KR> What is a date, and how is it represented in Emacs Lisp (i.e. a number or
KR> string or some other data type, and in what format)?

The Unix timestamp can be converted to a visual date with
`format-time-string', e.g.

M-: (format-time-string "%F %T" (current-time))

but the actual format string should be up to the user.  Really, my
question is "how do I find numbers that look like 1292527019, run a
function on them, and then show the results of that function overlaid on
top of the number without actually changing it in the buffer?"

Thanks
Ted


reply via email to

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