[Top][All Lists]

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

[h-e-w] (no subject)

From: Stephen Gildea
Subject: [h-e-w] (no subject)
Date: Thu, 10 Feb 2005 17:41:46 -0500

You need to set time-stamp-time-zone to a value that the system
understands; a value that looks pretty to you isn't necessarily good

Try this experiment at a Bash shell:

$ TZ=CST date

Did you get your date and time printed in the time zone you wanted?
If not, then setting Emacs's time-stamp-time-zone to "CST" won't work,

Following the Posix spec, include a number after your abbreviation
that gives the hours west of GMT.  For example, "CST6".

$ TZ=CST6 date

That probably works better.  If not, you will need some research
and experimentation to find what works for your system.

Here is some Emacs Lisp code to set time-stamp-time-zone to a value
like "CST6" on your system.

;;; Converts a time zone name like "Central Standard Time" to the
;;; acronym for that time, e.g., "CST".  Appends the offset in hours.
(setq time-stamp-time-zone
      (let ((tz-offset (car (current-time-zone)))
            (tz-name (cadr (current-time-zone))))
        (concat (mapconcat '(lambda (s) (substring s 0 1))
                           (split-string tz-name) "")
                (int-to-string (/ (- tz-offset) 3600)))))

reply via email to

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