# man > Date::Manip::Migration5to6

---
type: CommandReference
command: Date::Manip::Migration5to6
mode: perldoc
section: ""
source: perldoc
---

## Quick Reference

- `Date_Init(ConfigFile => $file)` — replace `GlobalCnf`, `PersonalCnf`, `PathSep`, etc.
- `Date_ConvTZ($date, $from, $to)` — new 3‑argument signature; `$from` and `$to` default to local time zone.
- Use `SetDate` or `ForceDate` config variables instead of `ConvTZ` or `TZ`.
- Parse `"now"` for current time, `"-24:00:00"` for 24 hours ago, `"+24:00:00"` for 24 hours ahead.
- Do **not** use `Memoize` with `Date::Manip` — it may lead to incorrect results.
- Deprecated config variable `TZ` (removed Mar 2016); other removed variables: `IntCharSet`, `GlobalCnf`, `PersonalCnf`, `PathSep`, `IgnoreGlobalCnf`, `PersonalCnfPath`, `ConvTZ`, `Internal`, `TodayIsMidnight`, `DeltaSigns`, `UpdateCurrTZ`, `ResetWorkdDay`.

## Name

`Date::Manip::Migration5to6` — how to upgrade from 5.xx to 6.00

## Synopsis

When upgrading from `Date::Manip` 5.xx to 6.00, a few changes may be necessary to your scripts. The `Date::Manip::Changes5to6` document lists more details. Once the changes are made, your script will no longer run correctly in 5.xx.

## Changes

### Reading config files with `Date_Init`

Replace all of these config variables:

perl
GlobalCnf=FILE
PersonalCnf=FILE
PathSep=*
IgnoreGlobalCnf=*
PersonalCnfPath=*
with a single call:

perl
Date_Init(ConfigFile => $file);
`ConfigFile` must be the full path to a config file and should be the first argument.

### `Date_ConvTZ`

The function now takes three arguments:

perl
$date = Date_ConvTZ($date, $from, $to);
- `$from` defaults to the local time zone if not given.
- `$to` defaults to the local time zone if not given.
- The old `$errlevel` argument is no longer handled.

### `ConvTZ` and `TZ` config variables

Replace `ConvTZ` or `TZ` with either `SetDate` or `ForceDate`. See the `Date::Manip::Config` documentation. The `TZ` variable worked until Dec 2015 but was removed in Mar 2016.

### Other deprecated config variables

The following variables have been removed and will cause errors if used:

`IntCharSet`, `GlobalCnf`, `PersonalCnf`, `PathSep`, `IgnoreGlobalCnf`, `PersonalCnfPath`, `ConvTZ`, `Internal`, `TodayIsMidnight`, `DeltaSigns`, `UpdateCurrTZ`, `ResetWorkdDay`

### `today`, `yesterday`, `tomorrow`

These strings now refer strictly to the date (midnight). To get the current time, use `"now"`; for 24 hours ago/hence, use `"-24:00:00"` / `"+24:00:00"`.

| Old string | New string |
|------------|------------|
| `"today"` | `"now"` |
| `"yesterday"` | `"-24:00:00"` |
| `"tomorrow"` | `"+24:00:00"` |

### Do not use `Memoize`

Using `Memoize` with `Date::Manip` is no longer recommended — it provides little performance gain and may produce incorrect results, especially if config variables change.

## Examples

### Replacing `Date_Init` config variables

**Old (5.xx):**

perl
Date_Init(GlobalCnf => "/path/to/global.cnf",
          PersonalCnf => "/path/to/personal.cnf");
**New (6.00):**

perl
Date_Init(ConfigFile => "/path/to/config.cnf");
### Using `Date_ConvTZ`

**Old (5.xx):**

perl
$date = Date_ConvTZ($date, $from, $to, $errlevel);
**New (6.00):**

perl
$date = Date_ConvTZ($date, $from, $to);
### Parsing current time

**Old (5.xx):**

perl
$now = Date_Parse("today");
**New (6.00):**

perl
$now = Date_Parse("now");
## See Also

- [Date::Manip](https://metacpan.org/pod/Date::Manip)
- [Date::Manip::Changes5to6](https://metacpan.org/pod/Date::Manip::Changes5to6)
- [Date::Manip::Config](https://metacpan.org/pod/Date::Manip::Config)
- [Date::Manip::Problems](https://metacpan.org/pod/Date::Manip::Problems)