| 1 |
# Copyright (c) 2009-2026 Sullivan Beck. All rights reserved. |
| 2 |
# This program is free software; you can redistribute it and/or modify it |
| 3 |
# under the same terms as Perl itself. |
| 4 |
|
| 5 |
=pod |
| 6 |
|
| 7 |
=head1 NAME |
| 8 |
|
| 9 |
Date::Manip::Migration5to6 - how to upgrade from 5.xx to 6.00 |
| 10 |
|
| 11 |
=head1 SYNOPSIS |
| 12 |
|
| 13 |
When upgrading from Date::Manip 5.xx to 6.00, a few changes may be |
| 14 |
necessary to your scripts. |
| 15 |
|
| 16 |
The L<Date::Manip::Changes5to6> document lists in more detail the ways in |
| 17 |
which Date::Manip changed, but very few of these actually entail |
| 18 |
changes to your script. |
| 19 |
|
| 20 |
It should be noted that once the changes are made to your script, |
| 21 |
it will no longer run correctly in 5.xx. |
| 22 |
|
| 23 |
=head1 NECESSARY AND SUGGESTED CHANGES |
| 24 |
|
| 25 |
The following changes are necessary, or strongly suggested: |
| 26 |
|
| 27 |
=over 4 |
| 28 |
|
| 29 |
=item B<Reading config files with Date_Init> |
| 30 |
|
| 31 |
If you use Date_Init to read any config files (if you do business mode |
| 32 |
calculations, you probably do), you should remove all of the following |
| 33 |
config variables from your call to Date_Init: |
| 34 |
|
| 35 |
GlobalCnf=FILE |
| 36 |
PersonalCnf=FILE |
| 37 |
PathSep=* |
| 38 |
IgnoreGlobalCnf=* |
| 39 |
PersonalCnfPath=* |
| 40 |
|
| 41 |
and replace them with: |
| 42 |
|
| 43 |
ConfigFile=FILE |
| 44 |
|
| 45 |
where FILE is now the full path to a config file. Also, the ConfigFile |
| 46 |
argument should be the first argument in Date_Init. |
| 47 |
|
| 48 |
=item B<Date_ConvTZ> |
| 49 |
|
| 50 |
The Date_ConvTZ function has changed. It should now take 3 arguments: |
| 51 |
|
| 52 |
$date = Date_ConvTZ($date,$from,$to); |
| 53 |
|
| 54 |
If C<$from> is not given, it defaults to the local time zone. If C<$to> is |
| 55 |
not given, it defaults to the local time zone. |
| 56 |
|
| 57 |
The date is converted from the C<$from> time zone into the C<$to> |
| 58 |
time zone. Both should be any time zone (or alias) supported by |
| 59 |
Date::Manip. |
| 60 |
|
| 61 |
The old C<$errlevel> argument is no longer handled. |
| 62 |
|
| 63 |
=item B<ConvTZ and TZ config variables> |
| 64 |
|
| 65 |
If you use either the ConvTZ or TZ config variables, you should |
| 66 |
replace them with either SetDate or ForceDate. See the |
| 67 |
L<Date::Manip::Config> document for information. |
| 68 |
|
| 69 |
The TZ variable will continue to work until Dec 2015 at which point |
| 70 |
it will be removed. |
| 71 |
|
| 72 |
=item B<Other deprecated config variables> |
| 73 |
|
| 74 |
The following config variables have been deprecated, but will continue |
| 75 |
to function (though they will be removed at a future date): |
| 76 |
|
| 77 |
TZ (removed Mar 2016) |
| 78 |
|
| 79 |
The following variables have been removed. If you use any of them, |
| 80 |
you may need to modify your scripts: |
| 81 |
|
| 82 |
IntCharSet |
| 83 |
GlobalCnf |
| 84 |
PersonalCnf |
| 85 |
PathSep |
| 86 |
IgnoreGlobalCnf |
| 87 |
PersonalCnfPath |
| 88 |
ConvTZ |
| 89 |
Internal |
| 90 |
TodayIsMidnight |
| 91 |
DeltaSigns |
| 92 |
UpdateCurrTZ |
| 93 |
ResetWorkdDay |
| 94 |
|
| 95 |
=item B<today, yesterday, tomorrow> |
| 96 |
|
| 97 |
If you parse the strings "today", "yesterday", or "tomorrow" in order |
| 98 |
to get the time now, or 24 hours in the past/future, this will no |
| 99 |
longer work. These strings now refer strictly to the date (so "today" |
| 100 |
is the current day at midnight, "yesterday" is the previous day at |
| 101 |
midnight, etc.). |
| 102 |
|
| 103 |
To get the time now, 24 hours ago, or 24 hours in the future, you |
| 104 |
would need to parse the strings "now", "-24:00:00", or "+24:00:00" |
| 105 |
respectively. |
| 106 |
|
| 107 |
=item B<Do not use Memoize> |
| 108 |
|
| 109 |
In 5.xx, it was documented that you could use the module Memoize to |
| 110 |
speed up Date::Manip, especially when sorting dates. |
| 111 |
|
| 112 |
This information is no longer accurate. Using Memoize in conjunction |
| 113 |
with Date::Manip should have little impact on performance, and may |
| 114 |
lead to incorrect results, especially if you change config variables. |
| 115 |
|
| 116 |
Please refer to L<Date::Manip::Changes5to6/"GENERAL CHANGES"> for |
| 117 |
more information. |
| 118 |
|
| 119 |
=back |
| 120 |
|
| 121 |
If you find other instances where it is necessary to modify your |
| 122 |
script, please email me so that I can add that information to this |
| 123 |
document. |
| 124 |
|
| 125 |
=head1 BUGS AND QUESTIONS |
| 126 |
|
| 127 |
Please refer to the L<Date::Manip::Problems> documentation for |
| 128 |
information on submitting bug reports or questions to the author. |
| 129 |
|
| 130 |
=head1 SEE ALSO |
| 131 |
|
| 132 |
L<Date::Manip> - main module documentation |
| 133 |
|
| 134 |
=head1 LICENSE |
| 135 |
|
| 136 |
This script is free software; you can redistribute it and/or |
| 137 |
modify it under the same terms as Perl itself. |
| 138 |
|
| 139 |
=head1 AUTHOR |
| 140 |
|
| 141 |
Sullivan Beck ([email protected]) |
| 142 |
|
| 143 |
=cut |