Re: Perl and Time zones.

2002-12-14 Thread Dirk Koopman
If you download http://www.dxcluster.org/download/CVSlatest.tgz In amongst a whole load of other stuff, You will find a load of routines to show current sun/moon position, if that is of interest. It will need hacking because it is part of a much larger whole, but it was written by someone who unde

Re: Perl and Time zones.

2002-12-14 Thread Tamsin
Ta da! I got it working! What took the time was sorting out the data for each of the stations rather than writing the code. http://weatherpixie.com/?place=KNYC or if you want more info theres an embryonic XML thing here: http://weatherpixie.com/XML/?place=KNYC Thanks for all your suggestions,

Re: Perl and Time zones.

2002-12-10 Thread Mark
It may be a bit heavyweight for this purpose, but Date::Manip has a Date_ConvTZ function. Take care, Mark. On Sun, 8 Dec 2002, Tamsin wrote: > Date: Sun, 8 Dec 2002 17:17:19 + > From: Tamsin <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > S

Re: Perl and Time zones.

2002-12-10 Thread the hatter
On Tue, 10 Dec 2002, Andy Wardley wrote: > Tamsin wrote: > > > its not actually that easy and have better things to do than to work out > > the time zones for 6000 places for which I only have a longitude > > and latitude > > If at first you don't succeed, re-define the problem to make it easier :

Re: Perl and Time zones.

2002-12-10 Thread Andy Wardley
Tamsin wrote: > I have a silly weather website - weatherpixie.com. s/silly/cool/ > its not actually that easy and have better things to do than to work out > the time zones for 6000 places for which I only have a longitude > and latitude I realise that time zones don't work like this, but if

Re: Perl and Time zones.

2002-12-09 Thread Mark Fowler
Tamsin wrote: > Ever got the feeling you've opened a can of worms... At one point we thought it would be a good idea to teach dipsy, the infobot on #london.pm, to tell the time in various places. This is useful when you've got friends at conferences and you want to know what time they'll be awak

Re: Perl and Time zones.

2002-12-09 Thread Belden Lyman
Paul Mison wrote: On 09/12/2002 at 21:43 +, Tamsin wrote: Beware. I believe one US state (Montana IIRC) also stands out by only partially adopting daylight saving time. ie half of Montana does, half does not. Or maybe this is what you meant by the above comment. Montana seems to be mos

Re: Perl and Time zones.

2002-12-09 Thread Lusercop
On Mon, Dec 09, 2002 at 09:06:38PM +, Tamsin wrote: > Well at the moment the project is at the stage where I've just discovered > that time zone borders do not follow US state boundaries. G. Does the rotation of the earth follow US state boundaries? Why should they? Timezones are artifi

Re: Perl and Time zones.

2002-12-09 Thread Paul Mison
On 09/12/2002 at 21:43 +, Tamsin wrote: Beware. I believe one US state (Montana IIRC) also stands out by only partially adopting daylight saving time. ie half of Montana does, half does not. Or maybe this is what you meant by the above comment. Montana seems to be mostly MST, except for one

Re: Perl and Time zones.

2002-12-09 Thread Tamsin
Beware. I believe one US state (Montana IIRC) also stands out by only partially adopting daylight saving time. ie half of Montana does, half does not. Or maybe this is what you meant by the above comment. Montana seems to be mostly MST, except for one bit in the corner that is PST ... Maybe MS

Re: Perl and Time zones.

2002-12-09 Thread Nicholas Clark
On Mon, Dec 09, 2002 at 09:06:38PM +, Tamsin wrote: > Well at the moment the project is at the stage where I've just discovered that > time zone borders do not follow US state boundaries. G. Beware. I believe one US state (Montana IIRC) also stands out by only partially adopting daylight

Re: Perl and Time zones.

2002-12-09 Thread Tamsin
You could procmail him to the bit-bucket ... I could, but it would actually be nice to have local time .. It one of those situations where I wrote back being polite, and then realized that he was the same guy who mailed me back in April I strongly recommend using seconds. You'll have to

Re: Perl and Time zones.

2002-12-09 Thread David Cantrell
On Mon, Dec 09, 2002 at 08:24:32PM +, Tamsin wrote: > So basically I'm doing this to stop an extremely helpful Belgian mailing > me with links to windows .exe files that tell you time zones for places... You could procmail him to the bit-bucket ... > What I suspect I'm going to do is make a

Re: Perl and Time zones.

2002-12-09 Thread Tamsin
On Sun, Dec 08, 2002 at 05:17:19PM +, Tamsin wrote: Does anyone know how I'd go about finding out the time zone offset for a given time zone name? Yes, there have been mine & Mark's solution. What do you need it for? Yep, I've got the data I want now! I am surprised however that no one

Re: Perl and Time zones.

2002-12-09 Thread Paul Makepeace
On Sun, Dec 08, 2002 at 05:17:19PM +, Tamsin wrote: > Does anyone know how I'd go about finding out the time zone offset > for a given time zone name? Yes, there have been mine & Mark's solution. What do you need it for? Does the info need to stay extremely current? If not, you could just bat

Re: Perl and Time zones.

2002-12-09 Thread Mark Blackman
I've confirmed that theoriginal snippet works on OS X (10.2.2) (minus transcription error in gmttime) - Mark On Monday, December 9, 2002, at 12:35 pm, Tamsin wrote: that's odd. I developed and tested this on OSX, i think.. maybe it was the FreeBSD box. Are you running Jaguar? or 10.2? I ha

UNIX man sections was Re: Perl and Time zones.

2002-12-09 Thread Steve Mynott
On Sunday, Dec 8, 2002, at 23:27 Europe/London, Lusercop wrote: The name(number) specification is a reference to the manual entry for a command. It derives from the Unix Programmers Manual (what is now contained in the man(1) command) which also came in a printed version. The section numbers de

Re: Perl and Time zones.

2002-12-09 Thread Steve Keay
On Mon, Dec 09, 2002 at 02:47:15PM +, Dominic Mitchell wrote: > > This leads to some very handy shell aliases for finding out the time in > new york / california. > > % alias | grep date > estdate='TZ=EST5EDT date' > pstdate='TZ=PST8PDT date' ...and if you have gnu date, you can find out wh

Re: Perl and Time zones.

2002-12-09 Thread Dominic Mitchell
the hatter wrote: Yes, you're only setting the environment for the process that's executing. System picks a default $TZ that it hands to all processes spawned. If one of these is your shell, it'll inherit it, though you may have a login profile that changes it to something else before you see it.

Re: Perl and Time zones.

2002-12-09 Thread the hatter
On Mon, 9 Dec 2002, Tamsin wrote: > The changing of the environment variable only affects what happens in > that script not the whole of the machine?I have visions of > confusing the server for ever more... Yes, you're only setting the environment for the process that's executing. System pick

Re: Perl and Time zones.

2002-12-09 Thread Tamsin
that's odd. I developed and tested this on OSX, i think.. maybe it was the FreeBSD box. Are you running Jaguar? or 10.2? I have 10.2, but it is always possible that somewhere along the line I've broken the Macs time zones by tinkering with things I don't understand. Elegant it ain't.. In fa

Re: Perl and Time zones.

2002-12-09 Thread Lusercop
On Mon, Dec 09, 2002 at 02:23:52AM +, David M. Wilson wrote: > On Sun, Dec 08, 2002 at 11:27:09PM +, Lusercop wrote: > > 6 - Games > The maddest bit of it all is that games have their own man page section > -- even on commercial unixes. What the hell? I don't suspect it was a particularly

Re: Perl and Time zones.

2002-12-08 Thread David M. Wilson
On Sun, Dec 08, 2002 at 11:27:09PM +, Lusercop wrote: > 6 - Games The maddest bit of it all is that games have their own man page section -- even on commercial unixes. What the hell? I mean, take section 2 for instance, it could be split up. Then take 3, it _needs_ split up, but oooh no, we

Re: Perl and Time zones.

2002-12-08 Thread Paul Makepeace
On Sun, Dec 08, 2002 at 11:54:11PM +, Paul Makepeace wrote: > FWIW, intuition tells me, if I were doing this, to look at tzset(3). #!/usr/bin/perl -w use strict; use Inline C => <<'EOC'; #include #include #include int tz_offset(char *tz) { extern long timezone; long offset

Re: Perl and Time zones.

2002-12-08 Thread Mark Fowler
On Sun, 8 Dec 2002, Tamsin wrote: > I'm asking in the hope that someone has done something like this > before and can point me in the right direction. In addition to following all the other useful comments that people have already posted to this list, I'd like to suggest you might also consider a

Re: Perl and Time zones.

2002-12-08 Thread Dirk Koopman
and bitter experience tells me that you can't rely on these values being correct or, indeed, based on any semblance of reality at all. On Sun, 2002-12-08 at 23:54, Paul Makepeace wrote: > On Sun, Dec 08, 2002 at 11:44:21PM +, Mark Blackman wrote: > > Elegant it ain't.. In fact, there is a much

Re: Perl and Time zones.

2002-12-08 Thread Paul Makepeace
On Sun, Dec 08, 2002 at 11:44:21PM +, Mark Blackman wrote: > Elegant it ain't.. In fact, there is a much nicer way via > C and the localtime libc function (at least in FreeBSD) where > localtime returns a tm struct with the final member > 'gmtoff', GMT offset in seconds, but for some reason per

Re: Perl and Time zones.

2002-12-08 Thread Mark Blackman
that's odd. I developed and tested this on OSX, i think.. maybe it was the FreeBSD box. The TZ variable will go look under /usr/share/zoneinfo for a file of that name. man 3 tzset for details. Elegant it ain't.. In fact, there is a much nicer way via C and the localtime libc function (at least in

Re: Perl and Time zones.

2002-12-08 Thread Lusercop
On Sun, Dec 08, 2002 at 08:36:56PM +, Tamsin wrote: > >You will also need the descriptions or the compiled (with zic(8)) versions, > >for both of these versions. Presumably, though, these came with whatever > >system you're using. > What is Zic(8) and how would I know if it is there or not? Th

Re: Perl and Time zones.

2002-12-08 Thread Tamsin
use Time::Local; $ENV{TZ}="Australia/Sydney"; my @gmt=gmttime; my $tzdiff = timegm(@gmt)-timelocal(@gmt); is the kludgey way to do it, $tzdiff is in seconds. gmttime was a deliberate error? I was hoping for something a little more ... elegant. But it works, (yay! thanks!). Well to clarify i

Re: Perl and Time zones.

2002-12-08 Thread Mark Blackman
use Time::Local; $ENV{TZ}="Australia/Sydney"; my @gmt=gmttime; my $tzdiff = timegm(@gmt)-timelocal(@gmt); is the kludgey way to do it, $tzdiff is in seconds. - Mark On Sunday, December 8, 2002, at 05:17 pm, Tamsin wrote: I'm asking in the hope that someone has done something like this bef

Re: Perl and Time zones.

2002-12-08 Thread Tamsin
You will also need the descriptions or the compiled (with zic(8)) versions, for both of these versions. Presumably, though, these came with whatever system you're using. What is Zic(8) and how would I know if it is there or not? I got Time::ZoneInfo running on OSX, but I had to put a zone.tab f

Re: Perl and Time zones.

2002-12-08 Thread Tamsin
On Sun, Dec 08, 2002 at 05:17:19PM +, Tamsin wrote: Does anyone know how I'd go about finding out the time zone offset for a given time zone name? Time::Zone and Time::ZoneInfo look promising. Time::Zone claims to return offsets, but as far as I can tell it looks at the environment var

Re: Perl and Time zones.

2002-12-08 Thread Lusercop
On Sun, Dec 08, 2002 at 05:35:01PM +, David Cantrell wrote: > On Sun, Dec 08, 2002 at 05:17:19PM +, Tamsin wrote: > > Does anyone know how I'd go about finding out the time zone offset > > for a given time zone name? > Time::Zone and Time::ZoneInfo look promising. > > The future's bright,

Re: Perl and Time zones.

2002-12-08 Thread David Cantrell
On Sun, Dec 08, 2002 at 05:17:19PM +, Tamsin wrote: > Does anyone know how I'd go about finding out the time zone offset > for a given time zone name? Time::Zone and Time::ZoneInfo look promising. > -- > The future's bright, the future's orange! You are Leon and I claim my five pounds. -

Perl and Time zones.

2002-12-08 Thread Tamsin
I'm asking in the hope that someone has done something like this before and can point me in the right direction. Does anyone know how I'd go about finding out the time zone offset for a given time zone name? I know that most Unix boxes set the local time zone using some time zone files... Wh