# man > Date::Manip::Config(3pm)

yaml
---
type: CommandReference
command: Date::Manip::Config
mode: perldoc
section: 3pm
source: perldoc
---
## Quick Reference

- `$date->config("ConfigFile","/path/to/file")` — load config file
- `$date->config("Language","Russian")` — set language for parsing
- `$date->config("DateFormat","US")` — set MM/DD vs DD/MM
- `$date->config("YYtoYYYY",50)` — set 2-digit year window
- `$date->config("FirstDay",1)` — set Monday as first day of week
- `$date->config("WorkDayBeg","08:00")` — set work day start time
- `$date->config("SetDate","now,Europe/Rome")` — change time zone for "now"
- `$date->config("ForceDate","now")` — freeze "now" at current time

## Name

**Date::Manip::Config** — configuration for Date::Manip modules

## Synopsis

Configuration variables are set either when creating a Date::Manip object, via the `config` method, or by reading a config file. The `config` method is available in `Date::Manip::Base`, `Date::Manip::TZ`, `Date::Manip::Date`, `Date::Manip::Delta`, and `Date::Manip::Recur`. Functional interface uses `Date_Init("VAR=VAL")`. Config file lines: `VAR = VAL` or `*SECTION`. Comments start with `#`. Example:

perl
$date = Date::Manip::Date->new;
$date->config($var1,$val1,$var2,$val2,...);
## Options

### BASIC CONFIGURATION VARIABLES

- `Defaults` — restores all config variables to defaults (ignores its own value)
- `ConfigFile` — path to a config file to parse immediately; may be specified multiple times
- `Language` — language for parsing dates (case insensitive); see [Date::Manip::Lang](http://localhost/phpMan.php/perldoc/Date%3A%3AManip%3A%3ALang/markdown)
- `Encoding` — input/output encoding; syntax: `"ENC"`, `"INENC,OUTENC"`, or `"INENC,"` / `",OUTENC"`; special value `perl` for escape sequences
- `FirstDay` — first day of week (1=Monday, 7=Sunday); default Monday
- `Jan1Week1` — if non‑nil, first week of year always contains Jan 1 (ignores ISO‑8601)
- `Printable` — output format: 0=YYYYMMDDHH:MN:SS, 1=YYYYMMDDHHMNSS, 2=YYYY-MM-DD-HH:MN:SS

### DATE PARSING CONFIGURATION VARIABLES

- `DateFormat` — "US" interprets 12/10 as Dec 10; anything else interprets as Oct 12
- `YYtoYYYY` — controls 2‑digit year conversion: integer N (window CURR‑N to CURR+99‑N), "C" (current century), "C##" (specific century), or "C####" (100‑year period)
- `DefaultTime` — "midnight" (00:00:00) or "curr" (current time) when no time is parsed
- `PeriodTimeSep` — if 1, allow period (.) as time separator (e.g. 12.15.30)
- `Format_MMMYYYY` — "first" or "last" to interpret strings like "Jun 1925" as first/last day of month; also allows "1925 Jun"

### BUSINESS CONFIGURATION VARIABLES

- `WorkWeekBeg`, `WorkWeekEnd` — first and last days of work week (1=Monday, 7=Sunday); default Mon–Fri
- `WorkDay24Hr` — if non‑zero, treat work day as 24 hours (DST changes considered)
- `WorkDayBeg`, `WorkDayEnd` — start and end times of work day (e.g. "08:00", "17:00"); ignored if WorkDay24Hr is set
- `TomorrowFirst` — if 0, search for nearest business day looks to yesterday first (default looks to tomorrow)
- `EraseHolidays`, `EraseEvents` — erase current holiday/event lists (value ignored)

### RECURRENCE CONFIGURATION VARIABLES

- `RecurRange` — default recurrence range: "none", "year", "month", "week", "day", "all" (Jan 2 0001 – Dec 30 9999)
- `MaxRecurAttempts` — maximum attempts to find matching dates before assuming recurrence is invalid

### TIME ZONE RELATED CONFIGURATION VARIABLES

- `TZ` — deprecated. Use `SetDate` or `ForceDate` instead.
- `SetDate` — set current date/time/zone and allow it to advance using that zone’s rules. Syntax:
  - `"now"` — reset to system time
  - `"now,ZONE"` — use system time but in given zone
  - `"now,DSTFLAG,ZONE"` — with DST flag (std, dst, stdonly, dstonly)
  - `"zone,ZONE"` — convert subsequent "now" to alternate zone
  - `"DATE"` — set fixed date/time (YYYY-MM-DD-HH:MN:SS or YYYYMMDDHH:MN:SS)
  - `"DATE,ZONE"` or `"DATE,DSTFLAG,ZONE"`
- `ForceDate` — same syntax as `SetDate`, but "now" is frozen and does not change over time.

### DEPRECATED CONFIGURATION VARIABLES

- `TZ` — use `SetDate` or `ForceDate` instead. Scheduled for removal 2016‑03‑01.

## Examples

Config file (`/home/foo/Manip.cnf`):
text
DateFormat = US
Language   = English

*Holidays

Dec 25 =  Christmas
Jan 1  =  New Year's
Loading config file and setting language:
perl
$date->config("ConfigFile","/home/foo/Manip.cnf",
              "Language","Russian");
Setting time zone for all date operations:
perl
$date->config("SetDate","now,Europe/Rome");
Freezing current time:
perl
$date->config("ForceDate","now");
Using functional interface:
perl
Date_Init("ConfigFile=/tmp/file1");
Date_Init("SetDate=now,Europe/Rome");
Date_Init("Defaults=1");
## See Also

- [Date::Manip](http://localhost/phpMan.php/perldoc/Date%3A%3AManip/markdown) — main module documentation
- [Date::Manip::Lang](http://localhost/phpMan.php/perldoc/Date%3A%3AManip%3A%3ALang/markdown) — language support
- [Date::Manip::Holidays](http://localhost/phpMan.php/perldoc/Date%3A%3AManip%3A%3AHolidays/markdown) — holidays and events
- [Date::Manip::Objects](http://localhost/phpMan.php/perldoc/Date%3A%3AManip%3A%3AObjects/markdown) — multiple config objects
- [Date::Manip::TZ](http://localhost/phpMan.php/perldoc/Date%3A%3AManip%3A%3ATZ/markdown) — time zone handling
- [Date::Manip::Calc](http://localhost/phpMan.php/perldoc/Date%3A%3AManip%3A%3ACalc/markdown) — business calculations
- [Date::Manip::Recur](http://localhost/phpMan.php/perldoc/Date%3A%3AManip%3A%3ARecur/markdown) — recurrences
- [Date::Manip::Problems](http://localhost/phpMan.php/perldoc/Date%3A%3AManip%3A%3AProblems/markdown) — bug reporting

## Exit Codes

Not documented.