Discussion:
How to set the default timezone for messages being sent?
Bahodir Mansurov
2018-01-05 22:52:29 UTC
Permalink
Hello,

Is there a way to set the timezone of newly composed messages from
within Emacs (without changing the system timezone)? Specifically, I'm
interested in changing the timezone of the "Date" header of the messages
being sent.

Thanks,
B
Eric Abrahamsen
2018-01-06 16:39:07 UTC
Permalink
Post by Bahodir Mansurov
Hello,
Is there a way to set the timezone of newly composed messages from
within Emacs (without changing the system timezone)? Specifically, I'm
interested in changing the timezone of the "Date" header of the messages
being sent.
I think probably not. The date headers are made using
`message-make-date', which provides no way of getting at the optional
third argument to `format-time-string'.

Eric
Bob Newell
2018-01-07 23:55:47 UTC
Permalink
I think probably not. The date headers are made using
`message-make-date', which provides no way of getting at the optional
third argument to `format-time-string'.

If you just wanted to set a fixed time zone, it would be easy enough to
advise or replace message-make-date to make the time zone whatever you
wish. A conditional time zone would be more tricky but still could be done.
--
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *
Göktuğ Kayaalp
2018-01-08 00:42:03 UTC
Permalink
Post by Bahodir Mansurov
Hello,
Is there a way to set the timezone of newly composed messages from
within Emacs (without changing the system timezone)? Specifically, I'm
interested in changing the timezone of the "Date" header of the messages
being sent.
You can change the TZ variable in Emacs like:

(setenv "TZ" "Europe/London")

it works for me. I guess you can make a function like this (example in
pseudo-code):

(setf default-timezone (getenv "TZ"))

(defun send-message-with-timezone (tz)
(interactive (list (read-string "Timezone: ")))
(setenv "TZ" tz)
(message-send)
(setenv "TZ" default-timezone))

and bind it to C-c C-c in message-mode.
Post by Bahodir Mansurov
Thanks,
B
--
İ. Göktuğ Kayaalp <http://www.gkayaalp.com/>
024C 30DD 597D 142B 49AC
40EB 465C D949 B101 2427
Emanuel Berg
2018-01-08 01:10:48 UTC
Permalink
Post by Göktuğ Kayaalp
(setenv "TZ" "Europe/London")
it works for me. I guess you can make
a function like this (example in pseudo-code)
Better to do this in the shell's environment
file, e.g. ~/.zshenv for zsh:

export TZ='Europe/Stockholm'

You can pass this to a tool without setting it
system-wide like this, for example if your wife
has run off with you lawer and now lives in LA:

la-time () {
TZ="America/Los_Angeles" date
}
--
underground experts united
http://user.it.uu.se/~embe8573
Göktuğ Kayaalp
2018-01-08 05:22:26 UTC
Permalink
Post by Emanuel Berg
Post by Göktuğ Kayaalp
(setenv "TZ" "Europe/London")
it works for me. I guess you can make
a function like this (example in pseudo-code)
Better to do this in the shell's environment
Certainly, but AFAIU the OP wants to modify the timezone temporarily to
have a ‘Date:’ header in a certain timezone, different from his default
one, when sending some particular messages.
Post by Emanuel Berg
export TZ='Europe/Stockholm'
You can pass this to a tool without setting it
system-wide like this, for example if your wife
la-time () {
TZ="America/Los_Angeles" date
}
--
İ. Göktuğ Kayaalp <http://www.gkayaalp.com/>
024C 30DD 597D 142B 49AC
40EB 465C D949 B101 2427
Loading...