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

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

Re: Formatting time as local time?


From: Tim X
Subject: Re: Formatting time as local time?
Date: Wed, 08 Dec 2010 15:16:28 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Elena <egarrulo@gmail.com> writes:

> Hello,
>
> I'm trying to format the last modified time of a file as a string.
> However, I can't get it formatted as local time. Here is my code:
>
> (format-time-string "%a, %e %b %Y %T %Z" (nth 5 (file-attributes my-
> file-name)) nil) ;; nil -> Local Time
>
> I'm getting the time interpreted as Universal Time (the resulting hour
> does not match the properties of the file). This code:
>
> (format-time-string "%a, %e %b %Y %T %Z" (nth 5 (file-attributes my-
> file-name)) t) ;; t -> Universal Time
>
> returns the same string, which shouldn't be the case, should it?
>
> Thanks.

It could be if either your timezone is equivalent to +0000 or if, for
some reason, emacs isn't able to determine your timezone and is
defaulting to UTC

Verify timezone settings and then verify things like hw clock and
settings and then try a few of the other timzone realted functions and
see if you get better results. 

Tim


-- 
tcross (at) rapttech dot com dot au


reply via email to

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