TITLE
date-convert - Convert dates from one calendar to another.
SYNOPSIS
date-convert year 2016 month 4 day 1
date-convert -reverse year 1419 holiday 3
date-convert -help
date-convert -version
OPTIONS
-from
This option specifies the class to be converted from.
The default is -from=DateTime
.
-help
This option displays the documentation for this script. The script then exits.
-instantiater
This option specifies the name of the method used to instantiate the object to be converted from.
The default is 'new'
.
-reverse
If asserted, this Boolean option specifies that a reverse conversion is to be done. It works by swapping the values of the -from
and -to
options, whether specified or defaulted.
The default is -noreverse
.
serializer
This option specifies the name of the method to be used to serialize the object converted to. This method must not take any arguments. If a false value, the object is stringified.
The default is undef
.
-to
This option specifies the class to be converted to.
The default is -to=DateTime::Fiction::JRRTolkien::Shire
.
-version
This option displays the version of this script. The script then exits.
DETAILS
This Perl script uses DateTime modules to convert from one calendar to another.
The command-line arguments are passed verbatim to the -from
class' new()
method. The resultant object is passed to the -to
class' from_object()
method, and the result of that method is stringified.
By default, this script converts from DateTime
to DateTime::Fiction::JRRTolkien::Shire
, thus converting the given date from Gregorian to Shire Reckoning.
AUTHOR
Thomas R. Wyant, III wyant at cpan dot org
COPYRIGHT AND LICENSE
Copyright (C) 2017 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.