On Tue, 2003-07-15 at 22:13, Ben Bennett wrote:
> Given the date 02/11/03 in the locale en_US (so you can assume m/d/y),
> what year is that in?

It's in the year 3 A.D. Period. This is a 'simple' module so I don't
think it should try bending user input too much. If you assume it to be
2003, then how do I say it's the year 3?

I say by default, just use the user's input as gospel.

You could try all sorts of things as a window for the rollover, but
two-digit years are *always* context sensative.

Under "Date of Birth", the window would be 1903-2003.

Under "Indended date of travel", the window would be 2003-2102

(As hard as I wrack my brain I can't think of a time when I'd not be
sure if it was a past or future event I wanted the date for.)


Because of this, maybe the following would be the go:

DateTime::Format::Simple->new( handle_two_digit_year => 'past' )
# two digit years are 1904-2003

DateTime::Format::Simple->new( handle_two_digit_year => 'future' )
# two digit years are 2003-2102

DateTime::Format::Simple->new( handle_two_digit_year => 1970 )
# two digit years are 1970-2069 (just in case there is a need)

DateTime::Format::Simple->new(  )
# two digit years are 00-99 by default


And maybe:
DateTime::Format::Simple->new( handle_two_digit_year => -20 )
# two digit years are (DateTime->now->year() - 20) to
(DateTime->now->year() + 79)


My $0.02.

Cheers!
Rick

Reply via email to