From corliss at odinicfoundation.org Wed Jul 28 12:45:48 1999 From: corliss at odinicfoundation.org (corliss@odinicfoundation.org) Date: Wed Aug 4 23:56:56 2004 Subject: Alaska Perl Mongers Site reworked. . . Message-ID: Greetings: Just wanted to let everyone know that a new site design was donated to the AK Perl Mongers, and is on-line now. Obviously, we need a bit more content to flesh things out, but we're hoping the new look and feel of the site will appeal to everyone. AK Perl Mongers: We'd like to know which of you have personal web pages so that we can link to them. AKLUG'ers: Any other Alaskan Linux resources that might be of interest would be great. Send in the links, and we'll add those as well. All: Perl resources are what we're here for. Send us anything we may have missed. Anyway, thanks for listening, check out the site, and give us some feedback! --Arthur Corliss Bolverk's Lair -- http://www.odinicfoundation.org/arthur/ "Live Free or Die, the Only Way to Live" -- NH State Motto ================================================= Mailing list info: If at any time you wish to (un|re)subscribe to the list send the request to majordomo@hfb.pm.org. All requests should be in the body, and look like such subscribe anchorage-pm-list unsubscribe anchorage-pm-list From lsawyer at gci.com Wed Jul 28 14:15:54 1999 From: lsawyer at gci.com (Leif Sawyer) Date: Wed Aug 4 23:56:56 2004 Subject: Alaska Perl Mongers Site reworked. . . Message-ID: I've just stumbled across an interesting problem that I can't dredge up the answer to. I need a function to return the offset for the current timezone. I can do the following: perl -e 'use POSIX; print POSIX::strftime("%T %D (%Z)\n")' which outputs 11:10:00 07/28/99 (AKDT) What i need is to have: 11:10:00 07/28/99 -8 (AKDT) Any thoughts? ================================================= Mailing list info: If at any time you wish to (un|re)subscribe to the list send the request to majordomo@hfb.pm.org. All requests should be in the body, and look like such subscribe anchorage-pm-list unsubscribe anchorage-pm-list From wolfm at pobox.alaska.net Wed Jul 28 14:55:35 1999 From: wolfm at pobox.alaska.net (Michael Fowler) Date: Wed Aug 4 23:56:56 2004 Subject: Alaska Perl Mongers Site reworked. . . In-Reply-To: ; from Leif Sawyer on Wed, Jul 28, 1999 at 11:15:54AM -0800 References: Message-ID: <19990728115535.B544@pobox.alaska.net> The strftime function has a (apparently undocumented) specifier, %z, on my system. It returns an rfc822 numeric timezone, an offset from GMT. I don't know how portable this is, considering it's undocumented. You may want to use the Time::Timezone module, which provides the tz_local_offset and tz_offset functions. Alternatively, you can use the Date::Format module's strftime function, which documents the %z, and has quite a few other specifiers besides. Both modules can be found on CPAN. With any of the solutions you're going to get -0800, instead of just -8. This is to allow for half-hour timezone offsets, as well as offsets above 9, while still being easy to parse. Michael On Wed, Jul 28, 1999 at 11:15:54AM -0800, Leif Sawyer wrote: > I've just stumbled across an interesting problem > that I can't dredge up the answer to. > > I need a function to return the offset for the current timezone. > > I can do the following: > > perl -e 'use POSIX; print POSIX::strftime("%T %D (%Z)\n")' > > which outputs > > 11:10:00 07/28/99 (AKDT) > > What i need is to have: > > 11:10:00 07/28/99 -8 (AKDT) > > Any thoughts? > ================================================= > Mailing list info: If at any time you wish to (un|re)subscribe to > the list send the request to majordomo@hfb.pm.org. All requests > should be in the body, and look like such > subscribe anchorage-pm-list > unsubscribe anchorage-pm-list ================================================= Mailing list info: If at any time you wish to (un|re)subscribe to the list send the request to majordomo@hfb.pm.org. All requests should be in the body, and look like such subscribe anchorage-pm-list unsubscribe anchorage-pm-list From corliss at odinicfoundation.org Wed Jul 28 21:09:57 1999 From: corliss at odinicfoundation.org (corliss@odinicfoundation.org) Date: Wed Aug 4 23:56:56 2004 Subject: Perl monger web address In-Reply-To: <37A00F8D.EC6A5851@alaskapacific.edu> Message-ID: Urgh, I knew I was forgetting something. . . http://www.alaskapm.org/ On Thu, 29 Jul 1999, Donovan Arellano wrote: > When you posted the updated website info on aklug there was no refering > link...what is the link? > -- > Donovan Arellano > Anchorage, AK > > I love cats!!! > Want to trade recipes? > --Arthur Corliss Bolverk's Lair -- http://www.odinicfoundation.org/arthur/ "Live Free or Die, the Only Way to Live" -- NH State Motto ================================================= Mailing list info: If at any time you wish to (un|re)subscribe to the list send the request to majordomo@hfb.pm.org. All requests should be in the body, and look like such subscribe anchorage-pm-list unsubscribe anchorage-pm-list From lsawyer at gci.com Thu Jul 29 13:27:42 1999 From: lsawyer at gci.com (Leif Sawyer) Date: Wed Aug 4 23:56:56 2004 Subject: Getting TZ in HH:MM, portably Message-ID: Of course, this works.. (and for some reason i didn't think of it before) use Time::Local; sub get_tz_offset { my $offset = sprintf "%.1f", (timegm(localtime) - time) / 3600; my $minutes = sprintf "%02d", ( $offset - int($offset) ) * 60; return(sprintf("%+03d%s", int($offset), $minutes) ); } Leave it to a perl monger to supply his own fix... :-) > -----Original Message----- > From: Michael Fowler [mailto:wolfm@pobox.alaska.net] > Sent: Wednesday, July 28, 1999 11:56 AM > To: Leif Sawyer > Cc: Anchorage Perl Mongers > Subject: Re: Alaska Perl Mongers Site reworked. . . > > > The strftime function has a (apparently undocumented) > specifier, %z, on my > system. It returns an rfc822 numeric timezone, an offset from GMT. > > I don't know how portable this is, considering it's > undocumented. You may > want to use the Time::Timezone module, which provides the > tz_local_offset and > tz_offset functions. Alternatively, you can use the > Date::Format module's > strftime function, which documents the %z, and has quite a few other > specifiers besides. Both modules can be found on CPAN. > > With any of the solutions you're going to get -0800, instead > of just -8. > This is to allow for half-hour timezone offsets, as well as > offsets above 9, > while still being easy to parse. > > > Michael > > > On Wed, Jul 28, 1999 at 11:15:54AM -0800, Leif Sawyer wrote: > > I've just stumbled across an interesting problem > > that I can't dredge up the answer to. > > > > I need a function to return the offset for the current timezone. > > > > I can do the following: > > > > perl -e 'use POSIX; print POSIX::strftime("%T %D (%Z)\n")' > > > > which outputs > > > > 11:10:00 07/28/99 (AKDT) > > > > What i need is to have: > > > > 11:10:00 07/28/99 -8 (AKDT) > > > > Any thoughts? > > ================================================= > > Mailing list info: If at any time you wish to (un|re)subscribe to > > the list send the request to majordomo@hfb.pm.org. All requests > > should be in the body, and look like such > > subscribe anchorage-pm-list > > unsubscribe anchorage-pm-list > ================================================= Mailing list info: If at any time you wish to (un|re)subscribe to the list send the request to majordomo@hfb.pm.org. All requests should be in the body, and look like such subscribe anchorage-pm-list unsubscribe anchorage-pm-list