Time Zone

Paul Koning pkoning at equallogic.com
Wed Jan 3 06:46:00 PST 2007


>>>>> "Peter" == Peter Gordon <peter at pg-consultants.com> writes:

 Peter> Details are in the manual for "date" and works for Linux
 Peter> Examples: # TZ=NZ date '+%z'
 Peter> +1300

Note that all these examples show the offset as it is in effect at the
time you ask.  

If you want the "base" offset (the one when "summer" time is not in
effect) this won't work reliably.  One way is to pick a time that
isn't "summer" and feed that to "date" (with -r, which takes an
arguments in seconds since the Epoch).

You can do this in your program by using "strftime"; that's likely to
be easier than bringing up the date command in the shell, and should
be more portable too.  Even so, watch out for incompatibilities; in
Python at least, the %z format marker isn't implemented correctly in
Windows.  (It displays the timezone name instead, verbosely.)

	  paul





More information about the wx-users mailing list