|
Packit |
95306a |
# Copyright (c) 2009-2017 Sullivan Beck. All rights reserved.
|
|
Packit |
95306a |
# This program is free software; you can redistribute it and/or modify it
|
|
Packit |
95306a |
# under the same terms as Perl itself.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=pod
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=head1 NAME
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Date::Manip::Migration5to6 - how to upgrade from 5.xx to 6.00
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=head1 SYNOPSIS
|
|
Packit |
95306a |
|
|
Packit |
95306a |
When upgrading from Date::Manip 5.xx to 6.00, a few changes may be
|
|
Packit |
95306a |
necessary to your scripts.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The L<Date::Manip::Changes5to6> document lists in more detail the ways in
|
|
Packit |
95306a |
which Date::Manip changed, but very few of these actually entail
|
|
Packit |
95306a |
changes to your script.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
It should be noted that once the changes are made to your script,
|
|
Packit |
95306a |
it will no longer run correctly in 5.xx.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=head1 NECESSARY AND SUGGESTED CHANGES
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The following changes are necessary, or strongly suggested:
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=over 4
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=item B<Reading config files with Date_Init>
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If you use Date_Init to read any config files (if you do business mode
|
|
Packit |
95306a |
calculations, you probably do), you should remove all of the following
|
|
Packit |
95306a |
config variables from your call to Date_Init:
|
|
Packit |
95306a |
|
|
Packit |
95306a |
GlobalCnf=FILE
|
|
Packit |
95306a |
PersonalCnf=FILE
|
|
Packit |
95306a |
PathSep=*
|
|
Packit |
95306a |
IgnoreGlobalCnf=*
|
|
Packit |
95306a |
PersonalCnfPath=*
|
|
Packit |
95306a |
|
|
Packit |
95306a |
and replace them with:
|
|
Packit |
95306a |
|
|
Packit |
95306a |
ConfigFile=FILE
|
|
Packit |
95306a |
|
|
Packit |
95306a |
where FILE is now the full path to a config file. Also, the ConfigFile
|
|
Packit |
95306a |
argument should be the first argument in Date_Init.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=item B<Date_ConvTZ>
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The Date_ConvTZ function has changed. It should now take 3 arguments:
|
|
Packit |
95306a |
|
|
Packit |
95306a |
$date = Date_ConvTZ($date,$from,$to);
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If C<$from> is not given, it defaults to the local time zone. If C<$to> is
|
|
Packit |
95306a |
not given, it defaults to the local time zone.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The date is converted from the C<$from> time zone into the C<$to>
|
|
Packit |
95306a |
time zone. Both should be any time zone (or alias) supported by
|
|
Packit |
95306a |
Date::Manip.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The old C<$errlevel> argument is no longer handled.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=item B<ConvTZ and TZ config variables>
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If you use either the ConvTZ or TZ config variables, you should
|
|
Packit |
95306a |
replace them with either SetDate or ForceDate. See the
|
|
Packit |
95306a |
L<Date::Manip::Config> document for information.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The TZ variable will continue to work until Dec 2015 at which point
|
|
Packit |
95306a |
it will be removed.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=item B<Other deprecated config variables>
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The following config variables have been deprecated, but will continue
|
|
Packit |
95306a |
to function (though they will be removed at a future date):
|
|
Packit |
95306a |
|
|
Packit |
95306a |
TZ (removed Mar 2016)
|
|
Packit |
95306a |
|
|
Packit |
95306a |
The following variables have been removed. If you use any of them,
|
|
Packit |
95306a |
you may need to modify your scripts:
|
|
Packit |
95306a |
|
|
Packit |
95306a |
IntCharSet
|
|
Packit |
95306a |
GlobalCnf
|
|
Packit |
95306a |
PersonalCnf
|
|
Packit |
95306a |
PathSep
|
|
Packit |
95306a |
IgnoreGlobalCnf
|
|
Packit |
95306a |
PersonalCnfPath
|
|
Packit |
95306a |
ConvTZ
|
|
Packit |
95306a |
Internal
|
|
Packit |
95306a |
TodayIsMidnight
|
|
Packit |
95306a |
DeltaSigns
|
|
Packit |
95306a |
UpdateCurrTZ
|
|
Packit |
95306a |
ResetWorkdDay
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=item B<today, yesterday, tomorrow>
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If you parse the strings "today", "yesterday", or "tomorrow" in order
|
|
Packit |
95306a |
to get the time now, or 24 hours in the past/future, this will no
|
|
Packit |
95306a |
longer work. These strings now refer strictly to the date (so "today"
|
|
Packit |
95306a |
is the current day at midnight, "yesterday" is the previous day at
|
|
Packit |
95306a |
midnight, etc.).
|
|
Packit |
95306a |
|
|
Packit |
95306a |
To get the time now, 24 hours ago, or 24 hours in the future, you
|
|
Packit |
95306a |
would need to parse the strings "now", "-24:00:00", or "+24:00:00"
|
|
Packit |
95306a |
respectively.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=item B<Do not use Memoize>
|
|
Packit |
95306a |
|
|
Packit |
95306a |
In 5.xx, it was documented that you could use the module Memoize to
|
|
Packit |
95306a |
speed up Date::Manip, especially when sorting dates.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
This information is no longer accurate. Using Memoize in conjunction
|
|
Packit |
95306a |
with Date::Manip should have little impact on performance, and may
|
|
Packit |
95306a |
lead to incorrect results, especially if you change config variables.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Please refer to L<Date::Manip::Changes5to6/"GENERAL CHANGES"> for
|
|
Packit |
95306a |
more information.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=back
|
|
Packit |
95306a |
|
|
Packit |
95306a |
If you find other instances where it is necessary to modify your
|
|
Packit |
95306a |
script, please email me so that I can add that information to this
|
|
Packit |
95306a |
document.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=head1 BUGS AND QUESTIONS
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Please refer to the L<Date::Manip::Problems> documentation for
|
|
Packit |
95306a |
information on submitting bug reports or questions to the author.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=head1 SEE ALSO
|
|
Packit |
95306a |
|
|
Packit |
95306a |
L<Date::Manip> - main module documentation
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=head1 LICENSE
|
|
Packit |
95306a |
|
|
Packit |
95306a |
This script is free software; you can redistribute it and/or
|
|
Packit |
95306a |
modify it under the same terms as Perl itself.
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=head1 AUTHOR
|
|
Packit |
95306a |
|
|
Packit |
95306a |
Sullivan Beck (sbeck@cpan.org)
|
|
Packit |
95306a |
|
|
Packit |
95306a |
=cut
|