Time::Moment::Ext - Extend Time::Moment with strptime and SQL dates support
use Time::Moment::Ext; my $tm = Time::Moment::Ext->from_datetime('2015-01-18'); my $tm2 = Time::Moment::Ext->from_datetime('2015-01-20 10:33:45'); my $tm3 = Time::Moment::Ext->strptime('2015-01-20 10:33:45', '%Y-%m-%d %H:%M:%S'); say $tm->to_datetime; say $tm2->to_date; say $tm3->to_time; say $tm->day; # (you can use all other methods from Time::Moment)
The method use all strptime features from Time::Piece
Converting SQL data/datetime string to Time::Moment object
Converting Time::Moment object to SQL datetime string
Converting Time::Moment object to date string
Converting Time::Moment object to time string
Return the day of month (alias to day_of_month)
version 0.06
Konstantin Cherednichenko <dshadowukraine@gmail.com>
Copyright 2017 (c) Konstantin Cherednichenko.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
To install Time::Moment::Ext, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Time::Moment::Ext
CPAN shell
perl -MCPAN -e shell install Time::Moment::Ext
For more information on module installation, please visit the detailed CPAN module installation guide.