Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* How to set the default timezone for messages being sent?
@ 2018-01-05 22:52 Bahodir Mansurov
  2018-01-06 16:39 ` Eric Abrahamsen
  2018-01-08  0:42 ` Göktuğ Kayaalp
  0 siblings, 2 replies; 6+ messages in thread
From: Bahodir Mansurov @ 2018-01-05 22:52 UTC (permalink / raw)
  To: info-gnus-english

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set the default timezone for messages being sent?
  2018-01-05 22:52 How to set the default timezone for messages being sent? Bahodir Mansurov
@ 2018-01-06 16:39 ` Eric Abrahamsen
  2018-01-07 23:55   ` Bob Newell
  2018-01-08  0:42 ` Göktuğ Kayaalp
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2018-01-06 16:39 UTC (permalink / raw)
  To: info-gnus-english

Bahodir Mansurov <bahodir@mansurov.org> writes:

> 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set the default timezone for messages being sent?
  2018-01-06 16:39 ` Eric Abrahamsen
@ 2018-01-07 23:55   ` Bob Newell
  0 siblings, 0 replies; 6+ messages in thread
From: Bob Newell @ 2018-01-07 23:55 UTC (permalink / raw)
  To: info-gnus-english

      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 *


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set the default timezone for messages being sent?
  2018-01-05 22:52 How to set the default timezone for messages being sent? Bahodir Mansurov
  2018-01-06 16:39 ` Eric Abrahamsen
@ 2018-01-08  0:42 ` Göktuğ Kayaalp
  2018-01-08  1:10   ` Emanuel Berg
  1 sibling, 1 reply; 6+ messages in thread
From: Göktuğ Kayaalp @ 2018-01-08  0:42 UTC (permalink / raw)
  To: Bahodir Mansurov; +Cc: info-gnus-english

On 2018-01-05 23:52 +01, Bahodir Mansurov <bahodir@mansurov.org> wrote:
> 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.

> Thanks,
> B
>

-- 
İ. Göktuğ Kayaalp	<http://www.gkayaalp.com/>
			 024C 30DD 597D 142B 49AC
			 40EB 465C D949 B101 2427

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set the default timezone for messages being sent?
  2018-01-08  0:42 ` Göktuğ Kayaalp
@ 2018-01-08  1:10   ` Emanuel Berg
  2018-01-08  5:22     ` Göktuğ Kayaalp
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2018-01-08  1:10 UTC (permalink / raw)
  To: info-gnus-english

Kayaalp wrote:

> 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)

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to set the default timezone for messages being sent?
  2018-01-08  1:10   ` Emanuel Berg
@ 2018-01-08  5:22     ` Göktuğ Kayaalp
  0 siblings, 0 replies; 6+ messages in thread
From: Göktuğ Kayaalp @ 2018-01-08  5:22 UTC (permalink / raw)
  To: info-gnus-english

On 2018-01-08 02:10 +01, Emanuel Berg <moasen@zoho.com> wrote:
> Kayaalp wrote:
>
>> 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)
>
> Better to do this in the shell's environment
> file, e.g. ~/.zshenv for zsh:

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.

>     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
> }

-- 
İ. Göktuğ Kayaalp	<http://www.gkayaalp.com/>
			 024C 30DD 597D 142B 49AC
			 40EB 465C D949 B101 2427

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-08  5:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05 22:52 How to set the default timezone for messages being sent? Bahodir Mansurov
2018-01-06 16:39 ` Eric Abrahamsen
2018-01-07 23:55   ` Bob Newell
2018-01-08  0:42 ` Göktuğ Kayaalp
2018-01-08  1:10   ` Emanuel Berg
2018-01-08  5:22     ` Göktuğ Kayaalp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).