From owner-ntemacs-users@trout  Sat May 17 08:36:31 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Sat" "17" "May" "1997" "08:25:57" "-0600" "Charles Curley" "ccurley@wyoming.com" nil "77" "Re: time-stamp & time-zone" "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id IAA28998 for <voelker@june.cs.washington.edu>; Sat, 17 May 1997 08:36:31 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id IAA28496 for <voelker@joker.cs.washington.edu>; Sat, 17 May 1997 08:36:30 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id HAA23600 for <ntemacs-users@trout.cs.washington.edu>; Sat, 17 May 1997 07:25:20 -0700 (PDT)
Received: from mailhost.wyoming.com (CALAMITY.WYOMING.COM [199.190.151.2]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id HAA27062 for <ntemacs-users@cs.washington.edu>; Sat, 17 May 1997 07:25:19 -0700
Received: from ccurley.wyoming.com ([204.227.197.35])           by mailhost.wyoming.com (post.office MTA v2.0 0813 ID# 0-11190)           with SMTP id AAB1179; Sat, 17 May 1997 08:25:16 -0600
Message-Id: <3.0.1.32.19970517082557.006fde04@mailhost.wyoming.com>
X-Sender: ccurley@mailhost.wyoming.com
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
In-Reply-To: <3.0.32.19970517012327.0070d42c@pop-server.crl.dec.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: Charles Curley <ccurley@wyoming.com>
To: Chris Weikart <weikart@crl.dec.com>
Cc: ntemacs-users@cs.washington.edu
Subject: Re: time-stamp & time-zone
Date: Sat, 17 May 1997 08:25:57 -0600

At 01:23 17/5/97 -0400, Chris Weikart wrote:
>I've enabled time-stamping with the following:
>
>      (setq time-stamp-format "%3a %3b %2d %02H:%02M:%02S %Z %y by %u")
>      (setq time-stamp-start "Last modified on[ ]+\\\\?[.]*")
>      (setq time-stamp-end "\\\\?[.]*$")
>      (setq time-stamp-line-limit 999999) ;; big!
>      (if (not (memq 'time-stamp write-file-hooks))
>	  (setq write-file-hooks
>		(cons 'time-stamp write-file-hooks)))
>
>This works fine, except: the time-zone name ("EDT", for instance) is not
>where %Z should've put it. For example, I get:
>
>	;; Last modified on Sat May 17 01:13:31  1997 by weikart
>
>I found that this is because (by default) the "TZ" environment variable
>isn't set under Win95/NT. If I set it explicitly, like this:
>
>      (if (not (getenv "TZ")) (setenv "TZ" "EDT"))
>
>then things work:
>
>	;; Last modified on Sat May 17 01:13:31 EDT 1997 by weikart
>
>But I don't want to hardwire the name, I want to determine it. I can call
>(current-time-zone), which for EDT returns:
>
>	(-14400 "")
>
>And I can use a hack like this to return either "EDT" or "EST":
>
>      (defun current-time-zone-name ()
>	"Return the current east coast time-zone name [weikart]."
>	(let* ((z (current-time-zone))
>	       (name (car (cdr z))))
>	  (if (and name (not (equal name ""))) name
>	    (if (= (car z) -14400) "EDT" "EST"))))
>
>The function works in isolation, but if I use it to set "TZ":
>
>      (if (not (getenv "TZ")) (setenv "TZ" (current-time-zone-name)))
>
>then the time-zone name is once again missing from the time stamp. In fact,
>I find that subsequent calls to (current-time-zone) return:
>
>	(0 "EDT")
>
>And at this point I realize that (current-time-zone) depends on the "TZ"
>environment variable in ways that I'm too tired to go and puzzle out.
>
>So: how do I get the time-zone name into the time-stamp format?
>
>-Chris

The time stamp format should probably be the same as that used by Unix and
by PGP and other programs on Mess-DOS: set "TZ=stdhdlt", where std is the
standard time time zone desigantion, h is the hour delta from gmt, and dlt
is the daylight time zone designation. For example, in Wyoming, I use

SET TZ=MST7MDT

for Mountain Standard Time, 7 hours, and Mountain Daylight Time.

Try setting it in your autoexec.bat.

I have not worked with the time stamp stuff in Emacs, but I suspect that it
respects the format I have described here, and you can probably take out
the code you added.

Hope this helps.


		-- C^2

Looking for fine software and/or web pages?
http://web.idirect.com/~ccurley

From owner-ntemacs-users@trout  Fri May 16 23:24:46 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Sat" "17" "May" "1997" "01:23:29" "-0400" "Chris Weikart" "weikart@crl.dec.com" "<3.0.32.19970517012327.0070d42c@pop-server.crl.dec.com>" "62" "time-stamp & time-zone" "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id XAA12407 for <voelker@june.cs.washington.edu>; Fri, 16 May 1997 23:24:46 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id XAA28505 for <voelker@joker.cs.washington.edu>; Fri, 16 May 1997 23:24:44 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id WAA13771 for <ntemacs-users@trout.cs.washington.edu>; Fri, 16 May 1997 22:24:15 -0700 (PDT)
Received: from crl.dec.com (crl.dec.com [192.58.206.2]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id WAA10499 for <ntemacs-users@cs.washington.edu>; Fri, 16 May 1997 22:24:12 -0700
Received: by crl.dec.com; id AA23052; Sat, 17 May 97 01:23:37 -0400
Received: by quabbin.crl.dec.com; id AA12820; Sat, 17 May 1997 01:23:31 -0400
Message-Id: <3.0.32.19970517012327.0070d42c@pop-server.crl.dec.com>
X-Sender: weikart@pop-server.crl.dec.com
X-Mailer: Windows Eudora Pro Version 3.0 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: Chris Weikart <weikart@crl.dec.com>
To: ntemacs-users@cs.washington.edu
Subject: time-stamp & time-zone
Date: Sat, 17 May 1997 01:23:29 -0400

I've enabled time-stamping with the following:

      (setq time-stamp-format "%3a %3b %2d %02H:%02M:%02S %Z %y by %u")
      (setq time-stamp-start "Last modified on[ ]+\\\\?[.]*")
      (setq time-stamp-end "\\\\?[.]*$")
      (setq time-stamp-line-limit 999999) ;; big!
      (if (not (memq 'time-stamp write-file-hooks))
	  (setq write-file-hooks
		(cons 'time-stamp write-file-hooks)))

This works fine, except: the time-zone name ("EDT", for instance) is not
where %Z should've put it. For example, I get:

	;; Last modified on Sat May 17 01:13:31  1997 by weikart

I found that this is because (by default) the "TZ" environment variable
isn't set under Win95/NT. If I set it explicitly, like this:

      (if (not (getenv "TZ")) (setenv "TZ" "EDT"))

then things work:

	;; Last modified on Sat May 17 01:13:31 EDT 1997 by weikart

But I don't want to hardwire the name, I want to determine it. I can call
(current-time-zone), which for EDT returns:

	(-14400 "")

And I can use a hack like this to return either "EDT" or "EST":

      (defun current-time-zone-name ()
	"Return the current east coast time-zone name [weikart]."
	(let* ((z (current-time-zone))
	       (name (car (cdr z))))
	  (if (and name (not (equal name ""))) name
	    (if (= (car z) -14400) "EDT" "EST"))))

The function works in isolation, but if I use it to set "TZ":

      (if (not (getenv "TZ")) (setenv "TZ" (current-time-zone-name)))

then the time-zone name is once again missing from the time stamp. In fact,
I find that subsequent calls to (current-time-zone) return:

	(0 "EDT")

And at this point I realize that (current-time-zone) depends on the "TZ"
environment variable in ways that I'm too tired to go and puzzle out.

So: how do I get the time-zone name into the time-stamp format?

-Chris


_______________________________________________________________________
Chris Weikart <weikart@crl.dec.com>     Digital Equipment Corporation
Speech Interaction Group (Web Apps)     Cambridge Research Laboratory
tel: (617) 692-7649, (DTN) 259-7649     One Kendall Square Bldg. 700
fax: (617) 692-7650, (DTN) 259-7650     Cambridge MA 02139-1562 USA

http://www.research.digital.com/CRL/personal/weikart/

From owner-ntemacs-users@trout  Sat May 17 11:05:23 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Sat" "17" "May" "1997" "10:22:13" "-0700" "ead@ixian.com" "ead@ixian.com" nil "40" "Re: time-stamp & time-zone" "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id KAA03946 for <voelker@june.cs.washington.edu>; Sat, 17 May 1997 10:58:44 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id KAA30853 for <voelker@joker.cs.washington.edu>; Sat, 17 May 1997 10:58:42 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id KAA24142 for <ntemacs-users@trout.cs.washington.edu>; Sat, 17 May 1997 10:23:58 -0700 (PDT)
Received: from proxy3.ba.best.com (proxy3.ba.best.com [206.184.139.14]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id KAA02780 for <ntemacs-users@cs.washington.edu>; Sat, 17 May 1997 10:23:58 -0700
Received: from UMIAK (dynamic6.pm06.mv.best.com [206.184.194.6]) by proxy3.ba.best.com (8.8.5/8.8.3) with SMTP id KAA15970; Sat, 17 May 1997 10:22:13 -0700 (PDT)
Message-Id: <199705171722.KAA15970@proxy3.ba.best.com>
Reply-to: <ead@ixian.com>
X-Humans-Reply-To: <ead@ixian.com>
X-URL: http://www.ixian.com/ixian/ead/
X-Mailer: GNU Emacs 19.34.1 (i386-*-nt4.0)
Organization: Ixian Systems
From: ead@ixian.com
To: Chris Weikart <weikart@crl.dec.com>
Cc: NT Emacs Users List <ntemacs-users@cs.washington.edu>
Subject: Re: time-stamp & time-zone
Date: Sat, 17 May 1997 10:22:13 -0700 (PDT)

Chris,

] And at this point I realize that (current-time-zone) depends on the "TZ"
] environment variable in ways that I'm too tired to go and puzzle out.
]
] So: how do I get the time-zone name into the time-stamp format?

I was lazy. I placed SET TZ=PST8PDT in C:\AUTOEXEC.BAT.

If I were to do the "right thing", I believe I would have "the system
administrator" extract timezone information from the registry, from one
of:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\TimeZoneInformation

    (Default)         (value not set)
    ActiveTimeBias    a4 01 00 00
    Bias              e0 01 00 00
    DaylightBias      c4 ff ff ff
    DaylightFlag      02 00 00 00
    DaylightName      "Pacific Daylight Time"
    DaylightStart     00 00 04 00 00 00 01 00 02 00 00 00 00 00 00 00
    StandardBias      00 00 00 00
    StandardName      "Pacific Standard Time"
    StandardStart     00 00 0a 00 00 00 05 00 02 00 00 00 00 00 00 00

and have him set TZ in C:\AUTOEXEC.BAT accordingly, for all the users to
avail themselves of.

Unfortunately, I *am* the sysadmin, and the only user, too, and I don't
know the first thing about programmatically extracting key values from
the registry.

Can anyone give me a pointer to solving this last problem?

Thank you,
Eric De Mund
--
Eric De Mund <ead@ixian.com>  |  PGP Key Fingerprint:
http://www.ixian.com/ead/     |  5349b223 af6c2081 eddd4c81 aac9d1a5

From owner-ntemacs-users@trout  Sun May 18 14:09:36 1997
X-VM-v5-Data: ([nil nil nil nil t nil nil nil nil]
	[nil "" "19" "May" "1997" "08:25:25" "+1300" "Jason Rumney" "jasonr@---spam-free-zone---.pec.co.nz" "<wkg1vkpopm.fsf@pachinko.pec.co.nz>" "22" "Re: time-stamp & time-zone" "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id OAA28654 for <voelker@june.cs.washington.edu>; Sun, 18 May 1997 14:09:35 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id OAA32475 for <voelker@joker.cs.washington.edu>; Sun, 18 May 1997 14:09:34 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id NAA15998 for <ntemacs-users@trout.cs.washington.edu>; Sun, 18 May 1997 13:24:17 -0700 (PDT)
Received: from janus.pec.co.nz (janus.pec.co.nz [202.20.64.195]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id NAA26670 for <ntemacs-users@cs.washington.edu>; Sun, 18 May 1997 13:24:13 -0700
Received: from PACHINKO (pachinko.pec.co.nz [202.36.208.29]) by janus.pec.co.nz (8.6.11/8.6.11) with SMTP id IAA13592 for <ntemacs-users@cs.washington.edu>; Mon, 19 May 1997 08:20:32 +1200
References: <3.0.1.32.19970517082557.006fde04@mailhost.wyoming.com>
Mime-Version: 1.0 (generated by tm-edit 7.85)
Content-Type: text/plain; charset=US-ASCII
In-Reply-To: Charles Curley's message of Sat, 17 May 1997 08:25:57 -0600
Message-ID: <wkg1vkpopm.fsf@pachinko.pec.co.nz>
Lines: 22
X-Mailer: Red Gnus v0.79/Emacs 19.34
From: Jason Rumney <jasonr@---spam-free-zone---.pec.co.nz>
To: ntemacs-users@cs.washington.edu
Subject: Re: time-stamp & time-zone
Date: 19 May 1997 08:25:25 +1300

In article <3.0.1.32.19970517082557.006fde04@mailhost.wyoming.com>, Charles Curley <ccurley@wyoming.com> writes:

> The time stamp format should probably be the same as that used by Unix and
> by PGP and other programs on Mess-DOS: set "TZ=stdhdlt", where std is the
> standard time time zone desigantion, h is the hour delta from gmt, and dlt
> is the daylight time zone designation. For example, in Wyoming, I use

> SET TZ=MST7MDT

The format should support the *FULL* POSIX timezone standard.  Far too
many DOS/Windows implementations support only the subset mentioned
above - which is fine if daylight savings starts and ends at the same
time in your area as it does in Redmond, Washington.  It falls over
severely when you move into the Southern Hemisphere.

AFAIK Emacs supports whatever the compiler it was compiled on has
support for.  Prior to MSVC++ 4.2, timezones only worked properly in
countries with the same daylight savings rules as the US.  Now they
work properly if the TZ environment variable is NOT set (consulting
the registry for settings), but as soon as you set a TZ variable you
are stuck with the lame subset of POSIX sepecified above.


