All pastes #814513 Raw Edit

Something

public text v1 · immutable
·published 2007-12-13 11:10 UTC
rendered paste body
Assuming that the time parsed into parsedate() can be split into a date and an arbitrary string, parsedate() seems to swallow "noon" and "midnight" from the artbirary string part, when it shouldn't.

For most anything else, if the parser runs into an invalid date before a valid string it will error and/or stop:

> print Dumper(parsedate("Foo 11pm"));   # no date/time before arbitrary string, so is invalid
$VAR1 = undef;
$VAR2 = 'no match on time/date';

But for noon:
> print Dumper(parsedate("Foo noon"));   # no date/time before arbitrary string, but Time::ParseDate swallows the "noon"
$VAR1 = 1197572400;
$VAR2 = 'Foo ';

> print Dumper(parsedate("Foo afternoon"));   # ditto
$VAR1 = 1197572400;
$VAR2 = 'Foo after';

And midnight:
> print Dumper(parsedate("Foo midnight"));   # ditto but for 'midnight'
$VAR1 = 1197529200;
$VAR2 = 'Foo ';