public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: TZ not working
@ 2000-06-15 14:15 David Bolen
  0 siblings, 0 replies; 4+ messages in thread
From: David Bolen @ 2000-06-15 14:15 UTC (permalink / raw)
  To: cygwin

Noel L Yap [yap_noel@jpmorgan.com]

> I've installed cygwin-1.1.2 and now all dates are displayed as UTC.
Setting
> TZ=US/Eastern or TZ=EST or TZ=EDT doesn't work.  How are timezones
described in
> Cygwin?

I believe the same as most Unix systems.  If I recall correctly, the strings
in the TZ setting (e.g., "EST") never really have any material impact on the
time, but exist only for presentation.  It's the numeric offset embedded in
the value that is key.  So you should fine it works with "TZ=EST5" or
"TZ=EST5EDT" (the most appropriate for Eastern).

At least on my system, without any setting Cygwin is also using my local NT
setting.  So if your machine itself has the proper local time you can
probably drop TZ altogether.  But if you set it to anything (e.g., your
"EST") then it is obeyed, and in the case of "EST" there is no offset, so
it's equivalent to "EST0" which is UTC time-wise.

-- David

/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l@fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* RE: TZ not working
@ 2000-06-16  6:19 Fifer, Eric
  0 siblings, 0 replies; 4+ messages in thread
From: Fifer, Eric @ 2000-06-16  6:19 UTC (permalink / raw)
  To: 'Noel L Yap', cygwin

[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]

>I've installed cygwin-1.1.2 and now all dates are displayed as UTC.
Setting
>TZ=US/Eastern or TZ=EST or TZ=EDT doesn't work.  How are timezones
described in
>Cygwin?

Cygwin's localtime() can understand zoneinfo style (TZ=US/Eastern)
timezones provided you have the zoneinfo database.  The latest
code/data can be found at:

	ftp://elsie.nci.nih.gov/pub/tzcode2000d.tar.gz
	ftp://elsie.nci.nih.gov/pub/tzdata2000d.tar.gz

Unpack both of these in the same directory.  Apply the attached
patch (you'll probably want to change the default LOCALTIME in
the Makefile to your local timezone, or change it later with
/usr/local/etc/zic -l US/Eastern).  Then, "make INSTALL".

The date command (from shellutils) does not display the timezone
(from tzset()/tzname[]) because newlib's strftime() does not
implement %Z.  However, the tzcode package includes a date/strftime
that works better in this respect.  If this is what you want, you
can move the default /bin/date.exe aside.

Hope this helps.

Eric Fifer


[-- Attachment #2: tz.patch --]
[-- Type: text/x-diff, Size: 2328 bytes --]

--- date.c.orig	Thu Apr 20 20:42:55 2000
+++ date.c	Mon May 15 16:45:05 2000
@@ -43,6 +43,7 @@
 #if HAVE_UTMPX_H
 #include "utmpx.h"
 #endif
+#include <sys/unistd.h>
 
 /*
 ** The two things date knows about time are. . .
@@ -57,7 +58,7 @@
 #endif /* !defined SECSPERMIN */
 
 extern double		atof();
-extern char **		environ;
+/*extern char **		environ;*/
 extern char *		getlogin();
 extern time_t		mktime();
 extern char *		optarg;
@@ -436,7 +437,7 @@
 #include "netinet/in.h"
 #include "netdb.h"
 #define TSPTYPES
-#include "protocols/timed.h"
+/*#include "protocols/timed.h" */
 
 extern int		logwtmp();
 
--- Makefile.orig	Thu Apr 20 20:42:49 2000
+++ Makefile	Mon May 15 16:45:06 2000
@@ -9,7 +9,7 @@
 #	make zonenames
 # to get a list of the values you can use for LOCALTIME.
 
-LOCALTIME=	Factory
+LOCALTIME=	Europe/London
 
 # If you want something other than Eastern United States time as a template
 # for handling POSIX-style time zone environment variables,
@@ -207,7 +207,7 @@
 # before the first Monday in January when a "%V" format is used and January 1
 # falls on a Friday, Saturday, or Sunday.
 
-CFLAGS=
+CFLAGS= -Dunix -DHAVE_STRERROR=1 -DHAVE_ADJTIME=0 -DHAVE_SETTIMEOFDAY=0
 
 # If you want zic's -s option used when installing, uncomment the next line
 # ZFLAGS=	-s
@@ -220,7 +220,7 @@
 
 ###############################################################################
 
-cc=		cc
+cc=		gcc
 CC=		$(cc) -DTZDIR=\"$(TZDIR)\"
 
 TZCSRCS=	zic.c localtime.c asctime.c scheck.c ialloc.c
@@ -265,7 +265,7 @@
 		-rm -f $(TZDIR)/iso3166.tab $(TZDIR)/zone.tab
 		cp iso3166.tab zone.tab $(TZDIR)/.
 		-mkdir $(TOPDIR) $(ETCDIR)
-		cp zic zdump $(ETCDIR)/.
+		cp zic.exe zdump.exe $(ETCDIR)/.
 		-mkdir $(TOPDIR) $(MANDIR) \
 			$(MANDIR)/man3 $(MANDIR)/man5 $(MANDIR)/man8
 		-rm -f $(MANDIR)/man3/newctime.3 \
@@ -280,7 +280,7 @@
 
 INSTALL:	ALL install date.1
 		-mkdir $(TOPDIR) $(BINDIR)
-		cp date $(BINDIR)/.
+		cp date.exe $(BINDIR)/.
 		-mkdir $(TOPDIR) $(MANDIR) $(MANDIR)/man1
 		-rm -f $(MANDIR)/man1/date.1
 		cp date.1 $(MANDIR)/man1/.
@@ -334,7 +334,7 @@
 		if [ -x /usr/ucb/ranlib -o -x /usr/bin/ranlib ] ; \
 			then ranlib ,lib.a ; fi
 		$(CC) $(CFLAGS) date.o localtime.o asctime.o strftime.o \
-			$(LDLIBS) -lc ,lib.a -o $@
+			$(LDLIBS) ,lib.a -o $@
 		rm -f ,lib.a
 
 tzselect:	tzselect.ksh


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

* Re: TZ not working
@ 2000-06-15 13:17 Earnie Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Earnie Boyd @ 2000-06-15 13:17 UTC (permalink / raw)
  To: Noel L Yap, cygwin

--- Noel L Yap <yap_noel@jpmorgan.com> wrote:
> I've installed cygwin-1.1.2 and now all dates are displayed as UTC.  Setting
> TZ=US/Eastern or TZ=EST or TZ=EDT doesn't work.  How are timezones described
> in
> Cygwin?
> 

My dates are displayed fine and I have TZ=EST5EDT.  As for how is it described,
the best answer is in the code.  Look at src/winsup/cygwin/localtime.c and
src/winsup/cygwin/times.cc.

Regards,

=====
---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://www.freeyellow.com/members5/gw32/index.html >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* TZ not working
@ 2000-06-15 12:50 Noel L Yap
  0 siblings, 0 replies; 4+ messages in thread
From: Noel L Yap @ 2000-06-15 12:50 UTC (permalink / raw)
  To: cygwin

I've installed cygwin-1.1.2 and now all dates are displayed as UTC.  Setting
TZ=US/Eastern or TZ=EST or TZ=EDT doesn't work.  How are timezones described in
Cygwin?

Thanks,
Noel



This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan & Co. Incorporated, its
subsidiaries and affiliates.


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

end of thread, other threads:[~2000-06-16  6:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-15 14:15 TZ not working David Bolen
  -- strict thread matches above, loose matches on Subject: below --
2000-06-16  6:19 Fifer, Eric
2000-06-15 13:17 Earnie Boyd
2000-06-15 12:50 Noel L Yap

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 read-only IMAP folder(s) and NNTP newsgroup(s).