missing something..

2007-01-25 Thread Matthew

am I missing something?


missing something..part 2

2007-01-25 Thread Matthew

yea..missing the body..sheesh

my $dt = DateTime-new( year = 2007, hour = 9,
time_zone = Etc/GMT+5
);


The timezone 'Etc/GMT+5' in an invalid name.

??

I see all the Etc/GMT+X inside my /usr/share/zoneinfo/Etc/ so what's up?

Are the Etc/GMT+X the proper generic time zones to use if your 
country/region isn't specified?


Thanks,
Matthew


Re: missing something..part 2

2007-01-25 Thread Matthew

Thanks Zefram,

 Note the change of sign: for historical reasons the signs in
 the Etc/GMT+X names are the opposite of the actual offset.

	Wow. Yea, that caused me quite a headache. I didn't realize that. Spent 
forever trying to figure out why GMT+5 kept subtracting hours.


 but it doesn't include the Etc pseudo-zones.

	Ok. Well then I can't use em. I've got to be able to use zones that 
exist in Perl, PHP and MySQL.



If your timezone isn't in the database, you should
mail the database maintainers to get it added.


	Hehe. I'm the DBA. And I've updated everything to most recent stuff, 
but the boss man wants generic time zones in our list just in case a 
customer can't find his or doesn't realize his city is listed differently.


Thanks,
Matthew


Re: missing something..part 2

2007-01-25 Thread Zefram
Matthew wrote:
   Hehe. I'm the DBA. And I've updated everything to most recent stuff, 
but the boss man wants generic time zones in our list just in case a 
customer can't find his or doesn't realize his city is listed differently.

Unlikely to ever occur.  As far as anyone knows, the Olson zoneinfo
database contains all currently-distinct timezones.  (It explicitly aims
to include all timezones that have been distinct at any time since 1970.)
You might want to play with the tzselect(8) program, which guides one
through selecting a geographical timezone from the database.

-zefram


Re: missing something..part 2

2007-01-25 Thread Ben Bennett
Or use DateTime::TimeZone::Alias [1]

(untested code follows)
  use DateTime::TimeZone::Alias

  for my $hr in (0 .. 12) {
DateTime::TimeZone::Alias-set(Etc/GMT+$hr, -${hr}:00);
DateTime::TimeZone::Alias-set(Etc/GMT-$hr, +${hr}:00);
  }
  # And don't forget the 15 minute offsets and the 30 minute offsets
  # Also, the offsets may go bigger than 12... check to see what you
  # have defined on your system

  Hehe. I'm the DBA. And I've updated everything to most recent stuff, 
 but the boss man wants generic time zones in our list just in case a 

He means the timezone database that is distributed with the perl
DateTime package, nor your (oracle/mysql/whatever) database.

 -ben

[1] 
http://search.cpan.org/~jhoblitt/DateTime-TimeZone-Alias-0.0501/lib/DateTime/TimeZone/Alias.pod


On Thu, Jan 25, 2007 at 04:18:02PM +, Zefram wrote:
 Matthew wrote:
  Hehe. I'm the DBA. And I've updated everything to most recent stuff, 
 but the boss man wants generic time zones in our list just in case a 
 customer can't find his or doesn't realize his city is listed differently.
 
 Unlikely to ever occur.  As far as anyone knows, the Olson zoneinfo
 database contains all currently-distinct timezones.  (It explicitly aims
 to include all timezones that have been distinct at any time since 1970.)
 You might want to play with the tzselect(8) program, which guides one
 through selecting a geographical timezone from the database.
 
 -zefram


Re: missing something..part 2

2007-01-25 Thread Dave Rolsky

On Thu, 25 Jan 2007, Zefram wrote:


Matthew wrote:

I see all the Etc/GMT+X inside my /usr/share/zoneinfo/Etc/ so what's up?


DateTime::TimeZone doesn't look in /usr/share/zoneinfo.  It has its own
version of the zoneinfo database, in the form of Perl modules, but it
doesn't include the Etc pseudo-zones.


It does include some of them, the ones which are defined as aliases to 
UTC like Etc/GMT and Etc/Zulu.


Supporting the rest would be fairly trivial, since they're just simple 
fixed offsets.



-dave

/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg.   My book blog
===*/


Re: missing something..part 2

2007-01-25 Thread Yitzchak Scott-Thoennes
Zefram wrote:
 Matthew wrote:
  Hehe. I'm the DBA. And I've updated everything to most recent stuff,
but the boss man wants generic time zones in our list just in case a
customer can't find his or doesn't realize his city is listed differently.

 Unlikely to ever occur.  As far as anyone knows, the Olson zoneinfo
 database contains all currently-distinct timezones.  (It explicitly aims
 to include all timezones that have been distinct at any time since 1970.)
 You might want to play with the tzselect(8) program, which guides one
 through selecting a geographical timezone from the database.

I don't think you read all the way to the end of Matthew's paragraph.

But FWIW, the Olson etcetera file has this to say:
# These entries are mostly present for historical reasons, so that
# people in areas not otherwise covered by the tz files could zic -l
# to a time zone that was right for their area.  These days, the
# tz files cover almost all the inhabited world, and the only practical
# need now for the entries that are not on UTC are for ships at sea
# that cannot use POSIX TZ settings.

-- 
I'm looking for a job: http://perlmonks.org/?node=ysth#looking



ANNOUNCE: Time::Local 1.17

2007-01-25 Thread Dave Rolsky

1.172007-01-25

- I made the same test count mistake as was in 1.14 again. This
  release fixes the test count (again) when running on a system that
  doesn't support negative epochs (like Win32). Patched by Kenichi
  Ishigaki (again).


Sigh.

-dave

/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg.   My book blog
===*/


SysV timezones in DT::TZ

2007-01-25 Thread Zefram
I've knocked together an implementation of SysV/POSIX
timezone specifications for DateTime.  Code is at
http://www.fysh.org/~zefram/tmp/SystemV.pm.  This is my first go at
implementing anything in the guts of DT, so experts here please check
that I'm using the interfaces correctly.  I don't quite follow what the
semantics are meant to be when a DT object has its timezone changed.

I'm not clear on which DateTime methods a timezone object can rely on,
in the arguments it is given to the _for_datetime methods.  I need to
do Gregorian arithmetic even if the DateTime isn't Gregorian.  I used
only -utc_rd_values and -local_rd_values, and then called out to my
Date::ISO8601 module to do the date arithmetic.

Is it OK for me to put this on CPAN?

-zefram