Data-VRM-GB
view release on metacpan or search on metacpan
data types yet.
EXPORTS
decode_vrm
A function which takes a VRM as its first and only argument, and
returns a HASHREF with the keys start_date and end_date. Each of those
keys has as its value a DateTime object, truncated to the 'day'.
If the registration mark couldn't be decoded to a date, either because
it's of an unrecognised format or is using a letter prefix that is not
understood, then it will return undef.
Before comparing these dates with another DateTime, you must ensure you
truncate your DateTime to the day. If you have a time portion, you will
get errors creeping in.
DateTime->compare(
decode_vrm('AB56 RST')->{end_date},
$your_dt->truncate(to => 'day')
The API is unstable - we haven't fully decided on the API and return data types yet.
=head1 EXPORTS
=head2 decode_vrm
A function which takes a VRM as its first and only argument, and returns a
HASHREF with the keys C<start_date> and C<end_date>.
Each of those keys has as its value a DateTime object, truncated to the 'day'.
If the registration mark couldn't be decoded to a date, either
because it's of an unrecognised format or is using a letter prefix that is
not understood, then it will return undef.
Before comparing these dates with another DateTime, you must ensure you
truncate your DateTime to the day. If you have a time portion, you will
get errors creeping in.
DateTime->compare(
decode_vrm('AB56 RST')->{end_date},
$your_dt->truncate(to => 'day')
lib/Data/VRM/GB.pm view on Meta::CPAN
The API is unstable - we haven't fully decided on the API and return data types yet.
=head1 EXPORTS
=head2 decode_vrm
A function which takes a VRM as its first and only argument, and returns a
HASHREF with the keys C<start_date> and C<end_date>.
Each of those keys has as its value a DateTime object, truncated to the 'day'.
If the registration mark couldn't be decoded to a date, either
because it's of an unrecognised format or is using a letter prefix that is
not understood, then it will return undef.
Before comparing these dates with another DateTime, you must ensure you
truncate your DateTime to the day. If you have a time portion, you will
get errors creeping in.
DateTime->compare(
decode_vrm('AB56 RST')->{end_date},
$your_dt->truncate(to => 'day')
( run in 0.250 second using v1.01-cache-2.11-cpan-26ccb49234f )