info > Date::Manip::Date

Not found locally for Date::Manip::Date. Try Google search

The user wants me to transform a Perl man page HTML into an emoji-rich, visually scannable version. Let me carefully follow the instructions: 1. Preserve structure - keep original headings/content intact 2. NEVER use

- start from

3. Section titles →

with emoji 4. Sub-sections →

with emoji 5. Comments in code are NOT headings 6. ALL code MUST be wrapped in

7. No emoji or links inside 

8. Preserve original code EXACTLY
9. Use proper HTML lists
10. Function references use 
  • name — description
  • WITHOUT per-item emoji 11. XSS prevention - escape < and > outside allowed tags 12. Output valid HTML only 13. Preserve all original technical info 14. Add 🚀 Quick Reference after NAME 15. Add 🚪 Exit Codes section only if original lists exit codes 16. Under 128,000 chars Let me work through this carefully. The original document has: - NAME - SYNOPSIS - DESCRIPTION - METHODS (with many sub-methods) - ISSUES WITH PARSING DATES - VALID TIME ZONE FORMATS - VALID DATE FORMATS - A NOTE ABOUT FOREIGN LANGUAGE DATES - VALID TIME FORMATS - VALID COMBINED DATE AND TIME FORMATS - PRINTF DIRECTIVES - KNOWN BUGS - BUGS AND QUESTIONS - SEE ALSO - LICENSE - AUTHOR Let me start building the HTML output. I need to escape < and > in code: - $date->calc needs to keep the -> but the < and > in things like need escaping - Looking through, I see ` should be escaped - Actually `scanf(<input>)` isn't in this content but I should still scan carefully - `print qq()` isn't here either - The `cmp or ` is mentioned with `<=>` already - Examples like `(?<PRE>.*?)` already use `<` and `>` - Format directives like `%` need to be escaped to `<A=NUM>` Let me also check: `Date::Manip::Date` etc. - these are valid tags I should preserve. Looking for escape needs: - `cmp or <=> operators` - already escaped - `Wed Feb 8 2006 24:00:00` - no escapes needed - `%` - needs escaping to `<A=NUM>` - `%` - needs escaping - `%` - needs escaping - `%` - needs escaping - `%` - needs escaping - `%` - needs escaping - `%` - needs escaping - `(?<PRE>.*?)` - already escaped in original For Quick Reference, I'll generate common use cases: - Create a new date object - Parse a date string - Get current value - Add/subtract deltas - Compare dates - Format date for output - Check if business day - Convert time zones For function/method references, I need to use
  • name — description
  • format WITHOUT per-item emoji. But this is a methods section that has long descriptions per method - so each method with its description should be in proper list format. Wait, re-reading: "For function, method, and class reference sections (pydoc modules, ruby ri classes, perldoc function lists): use
  • name(args) — description
  • format WITHOUT per-item emoji." So METHODS section should be a UL/LI list with tags for method names. But the methods have very long descriptions with multiple paragraphs, code examples, etc. I'll need to carefully structure this. Looking at the original METHODS section, it has: - A list of inherited methods (base, config, err, etc.) - Then detailed sections for: calc, cmp, complete, convert, holiday, input, is_business_day, list_holidays, list_events, nearest_business_day, next_business_day, prev_business_day, parse, parse_date, parse_time, parse_format, prev, next, printf, secs_since_1970_GMT, set, value, week_of_year Each method has detailed explanation. The "inherited" short list (base, config, err, etc.) can be a regular UL list with for method names. For each detailed method, I'll use

    with emoji prefix since they are sub-sections within the METHODS section. For the printf directives, those are reference-style format specs. Per the rules for function references, I should use
  • format — description
  • without per-item emoji. I'll structure those that way. Let me draft the HTML now. Actually, I need to be careful about the length. 128,000 chars is the limit. The original document is quite long. Let me try to keep it tight while preserving key sections. Let me structure now: ```html

    📛 NAME

    ...

    🚀 Quick Reference

    ...

    📋 SYNOPSIS

    ...

    📖 DESCRIPTION

    ...

    🔧 METHODS

    Inherited methods:

    • base
    • ...

    ⚙️ calc

    ...

    ...
    ... ``` Let me now build this comprehensively. I'll be careful about XSS - any < or > not in allowed tags needs escaping. Looking at all the < and > in content: - `` - no, this is just text mentioning format - `(?
    .*?)` already escaped as `(?<PRE>.*?)`
    - `` etc. need escaping to `<A=NUM>`
    - `` in perl context - already escaped
    - `` not in this doc
    - Are there other places? Let me scan again...
    
    Looking at "the comparison will automatically handle time zone differences between the two dates (i.e. they will be sorted in order as they appear in the GMT zone)." - no special chars
    
    Looking at "A string with a date and/or time may consist of any of the following:" - no special chars
    
    In print directives:
    - `%` → `%<A=NUM>`
    - same for other  directives
    
    In the parse_format section, I see usage like `(?<PRE>.*?)%Y-%m-%d(?<POST>.*)` already escaped, and named capture groups like `y`, `m`, `d` etc. in lists.
    
    Actually wait, looking more carefully:
    - "mixing numbered and named groups will work..."
    - "You may use capture groups (or back references to them)" - no special chars
    - The list of named groups - no special chars
    
    Looking at "subtract" - no special chars
    Looking at "[$first]" - no special chars
    Looking at format examples like `'%Y\\.%m\\-%d'` - no < or >
    
    OK, I think I've identified the spots that need escaping:
    - The `` format directives need to be escaped
    
    Let me now build the document.
    
    Actually wait, let me re-check: looking for `=>` in text - that's fine, no escaping needed because they are not HTML tags.
    
    But what about `=` in text? These are normal text. Let me search...
    "if no time zone information is included in the date, it is treated as being in the local time zone." - no < or >
    
    "" not present
    ":
    - "Wednesday is a holiday" - no
    - "On Sun" - no
    - "May be omitted" - no
    - Everything looks clean.
    
    Wait, the original docs already use `<` and `>` for the format directives? Let me check... no, they use `` directly. So I need to escape them.
    
    Now let me build the full document. I need to be efficient with characters.
    
    Let me also create Quick Reference. Common use cases:
    1. Create new date object
    2. Parse a date string
    3. Get date components
    4. Add/subtract delta
    5. Compare two dates
    6. Format date output
    7. Check business day
    8. Convert timezone
    
    Let me start writing the HTML now. I'll keep it tight.
    
    Wait, I should also examine the METHODS section format. Looking at it:
    
    ```
           base
           config
           err
           is_date
           is_delta
           is_recur
           new
           new_config
           new_date
           new_delta
           new_recur
           tz  Please refer to the Date::Manip::Obj documentation for these methods.
    
           calc
                  $date2 = $date->calc($delta [,$subtract]);
                  $delta = $date->calc($date2 [,$subtract] [,$mode]);
    ```
    
    The first 11 are short names. I'll use a 
      list with wrapping for them. The "tz" has a longer note. After this list, the rest are detailed methods with their own sub-sections. For each detailed method (calc, cmp, complete, etc.), I'll create an

      with emoji. Then include the description and code blocks. OK let me write this now. Looking at output character limit at 128,000 - this doc is fairly long. I need to balance verbosity with completeness. I'll keep all content but format tightly. Let me also handle the table for printf directives carefully - those are reference lists. Let me start drafting: ```html

      📛 NAME

      Date::Manip::Date - Methods for working with dates

      🚀 Quick Reference

    Use CaseCommandDescription
    Create date objectmy $date = new Date::Manip::Date;Instantiate new date object
    Parse string$date->parse("2024-03-15")Parse a date string
    Get value$date->value()Retrieve date components
    Add delta$date->calc($delta)Date arithmetic
    Compare$date1->cmp($date2)Compare two dates
    Format output$date->printf("%Y-%m-%d")Format date string
    Check business$date->is_business_day(1)Test if business day
    Convert tz$date->convert("UTC")Convert time zone
    Next biz day$date->next_business_day(0)Find next business day
    Epoch seconds$date->secs_since_1970_GMT()Unix timestamp
    ``` I think this is good. Let me continue. For METHODS, I'll make a list of inherited methods then break each major method into h3: ```html

    🔧 METHODS

    📚 Inherited Methods (see Date::Manip::Obj)

    • base
    • config
    • err
    • is_date
    • is_delta
    • is_recur
    • new
    • new_config
    • new_date
    • new_delta
    • new_recur
    • tz — See Date::Manip::Obj

    🧮 calc

    $date2 = $date->calc($delta [,$subtract]);
    $delta = $date->calc($date2 [,$subtract] [,$mode]);

    Please refer to the Date::Manip::Calc documentation for details.

    ``` And similar for each method. Let me write the full thing now. Actually, I realize I need to think more carefully about how to render the long descriptions. The methods each have: - A code signature - A description - Sometimes notes - Sometimes a table or list I'll need to format these clearly. Let me build it. For printf directives, this is a function reference. I'll structure as a table with Format | Description format: ```html

    📅 Year

    %yyear (00-99)
    %Yyear (0001-9999)
    ``` Actually the original uses nested h3/h4 structure with field names. Let me preserve that. The rule says function refs use
  • name description without per-item emoji, but the section heading can have emoji. So I'll group them and use a
    • directive description
    format. Actually for printf directives, since each directive has its own field categorization (Year, Month, Day, etc.), I think using

    for each category and
    • for each directive makes sense. Let me finalize my structure plan: 1. h2 - 📛 NAME 2. h2 - 🚀 Quick Reference (table) 3. h2 - 📋 SYNOPSIS (code block) 4. h2 - 📖 DESCRIPTION (paragraph) 5. h2 - 🔧 METHODS - h3 - 📚 Inherited Methods (list) - For each detailed method (calc, cmp, complete, convert, holiday, input, is_business_day, list_holidays, list_events, nearest_business_day, next_business_day, prev_business_day, parse, parse_date, parse_time, parse_format, prev, next, printf, secs_since_1970_GMT, set, value, week_of_year): h3 with method-relevant emoji, description, code blocks 6. h2 - ⚠️ ISSUES WITH PARSING DATES - h3 - 📆 Complete vs. truncated dates and times 7. h2 - 🌍 VALID TIME ZONE FORMATS 8. h2 - 📅 VALID DATE FORMATS - h3 - 🔢 ISO 8601 dates - h3 - 📅 Common date formats - h3 - 📅 Less common date formats - h3 - ✨ Special date strings - h3 - 🎉 Holidays 9. h2 - 🌐 A NOTE ABOUT FOREIGN LANGUAGE DATES 10. h2 - 🕐 VALID TIME FORMATS - h3 - 🔢 ISO 8601 times - h3 - 🕐 Other time formats - h3 - ✨ Special time strings 11. h2 - 🔗 VALID COMBINED DATE AND TIME FORMATS - h3 - 🔢 ISO 8601 combined - h3 - 🌍 Non-ISO 8601 combined - h3 - ➕ Deltas - h3 - ✨ Special combined strings - h3 - ➕ Additional combined formats 12. h2 - 🖨️ PRINTF DIRECTIVES - h3 for each category (Year, Day, Hour, etc.) 13. h2 - 🐛 KNOWN BUGS 14. h2 - ❓ BUGS AND QUESTIONS 15. h2 - 🔗 SEE ALSO 16. h2 - 📜 LICENSE 17. h2 - 👤 AUTHOR That's a comprehensive structure. Let me now write the HTML, being mindful of the character limit. I should also note that the original METHODS content where it shows signatures in indented form like: ``` calc $date2 = $date->calc($delta [,$subtract]); $delta = $date->calc($date2 [,$subtract] [,$mode]); Please refer to the Date::Manip::Calc documentation for details. ``` I should put the signatures in
       blocks without escaping > only where appropriate. The `$date->calc($delta)` has `->` so must be in code block. The signature has `[`, `]` etc. which are fine.
      
      Note: `[Y,M,D,H,MN,S]` - the brackets are fine, no escape needed.
      
      Wait, there are `` references in some places like in cmp section:
      "It returns -1, 0, or 1 similar to the cmp or  operators in perl."
      Already escaped as `<=>` in original. Good.
      
      And the format directives with `` need escaping:
      ```
      %, %, %
      %, %
      %
      %
      ```
      
      Let me now write the full response. I'll keep it tight but preserve all information.
      
      Let me draft section by section, being efficient:
      
      ```html
      

      📛 NAME

      Date::Manip::Date - Methods for working with dates

      ``` Hmm I need to be careful - per the rules, my output is HTML. I should be able to use the tags since they're allowed. But I should keep them as in original. Let me start writing: ```html

      📛 NAME

      Date::Manip::Date - Methods for working with dates

      🚀 Quick Reference

      Use CaseCommandDescription
      Create date objectmy $d = new Date::Manip::Date;Instantiate a new date object
      Parse a date string$d->parse("2024-03-15 14:30")Parse various date string formats
      Get date value$d->value()Returns Y,M,D,H,MN,S or formatted string
      Date arithmetic$d2 = $d1->calc($delta)Add/subtract a delta from date
      Compare dates$d1->cmp($d2)Compare two dates (-1, 0, 1)
      Format output$d->printf("%Y-%m-%d")Format date using printf directives
      Check business day$d->is_business_day(1)Test if date is a business day
      Convert timezone$d->convert("UTC")Convert date to a time zone
      Next/prev business day$d->next_business_day(0)Move to next business day
      Unix epoch seconds$d->secs_since_1970_GMT()Get epoch seconds since 1970
      Find holiday$d->holiday()Returns holiday name if applicable
      Week of year$d->week_of_year()Calculates the week number

      📋 SYNOPSIS

      use Date::Manip::Date;
      $date = new Date::Manip::Date;

      📖 DESCRIPTION

      This module works specifically with date objects.

      Although the word date is used extensively here, it is actually somewhat misleading. Date::Manip works with the full calendar date (year, month, day, and week when appropriate), time of day (hour, minute, second), and time zone. It doesn't work with fractional seconds.

      🔧 METHODS

      📚 Inherited Methods

      • base
      • config
      • err
      • is_date
      • is_delta
      • is_recur
      • new
      • new_config
      • new_date
      • new_delta
      • new_recur
      • tz — Please refer to the Date::Manip::Obj documentation for these methods.

      🧮 calc

      $date2 = $date->calc($delta [,$subtract]);
      $delta = $date->calc($date2 [,$subtract] [,$mode]);

      Please refer to the Date::Manip::Calc documentation for details.

      ⚖️ cmp

      $val = $date1->cmp($date2);

      Compares two different dates (both must be valid date objects). Returns -1, 0, or 1 similar to the cmp or <=> operators in Perl. The comparison will automatically handle time zone differences between the two dates (i.e. they will be sorted in order as they appear in the GMT zone).

      ⚠️ A warning is printed if either of the date objects does not include a valid date.

      ✅ complete

      $flag = $date->complete([$field]);

      Tests the date stored in the object to see if it is complete or truncated.

      • If no $field is passed in, returns 1 if the date is complete, or 0 if it was truncated and default values have been supplied.
      • If $field is passed in, it may be one of: m, d, h, mn, s. Returns 1 if the value for that field was specified, or 0 if a default was used.

      🌍 convert

      $err = $date->convert([$zone]);

      Converts the date stored in the object to a different time zone. $zone can be the name of a time zone. If not passed in, the date is converted to the local time zone.

      🎉 holiday

      $name = $date->holiday();
      @name = $date->holiday();
      $name = $date->event();

      Returns the name of the holiday if $date is a holiday. If not, undef is returned. If it's an unnamed holiday, an empty string is returned.

      • 📌 In scalar context: returns name of one holiday that occurs on that date (first defined in config file).
      • 📋 In list context: returns all holidays on that date.

      📥 input

      $str = $date->input();

      Returns the string that was parsed to form the date.

      💼 is_business_day

      $flag = $date->is_business_day($checktime);

      Returns 1 if $date is a business day.

      $checktime is optional. If non-zero, time is checked to see if the date falls within work hours.

      📅 list_holidays

      @date = $date->list_holidays([$y]);

      Returns a list of Date::Manip::Date objects containing all dates during a year which are holidays. The times will all be 00:00:00.

      If $y is not passed in, it will list the holidays in the same year as the date stored in $date (if any) or in the current year otherwise.

      📆 list_events

      @list = $date->list_events(       [$format] );
      @list = $date->list_events(0      [,$format]);
      @list = $date->list_events($date1 [,$format]);

      Returns a list of events. Events are defined in the Events section of the config file (discussed in the Date::Manip::Holidays manual).

      • 📌 First form: all events active at the precise time stored in $date.
      • ⏪ If first arg evaluates to 0: all events active at any time during that day (Y,M,D).
      • 📅 If first arg is another date object: all events active at any time between the two dates (inclusive).

      By default, the list returned is of the form:

      ( [START, END, NAME],
        [START, END, NAME],
        ...
      )

      Where START is a date object when an event starts, END is when it ends, and NAME is the event name.

      If $format is included, with the value "dates", it returns:

      ( [DATE1, NAME1a, NAME1b, ...],
        [DATE2, NAME2a, NAME2b, ...],
        ...
      )

      This includes a list of all dates during the range when there is a change in what events are active. DATE1 will always be the start of the range being considered. A date may be included which has no active events (the list of names will be empty).

      🏢 nearest_business_day

      $date->nearest_business_day([$tomorrowfirst]);

      Looks for the work day nearest to $date. If $date is a work day, it is left unmodified. Otherwise, it will look forward or backwards in time 1 day at a time until a work day is found.

      If $tomorrowfirst is non-zero (or omitted and the config variable TomorrowFirst is non-zero), we look to the future first. Otherwise, we look in the past first.

      📝 Example behavior (normal week, no holidays):

      • Wednesday → returns Wednesday
      • Saturday → returns Friday
      • Sunday → returns Monday
      • If Wednesday is a holiday: Thursday (if $tomorrowfirst is non-nil) or Tuesday (otherwise)

      ⏭️ next_business_day / ⏮️ prev_business_day

      $date->next_business_day($off [,$checktime]);
      $date->prev_business_day($off [,$checktime]);

      next_business_day sets the date to $off (positive integer or zero) business days in the future. prev_business_day sets it to $off business days in the past.

      • 🕐 First, $date is tested. If $checktime is nonzero, the date must fall on a business date during business hours. If 0, just the date matters.
      • ⏩ If the check fails, the date is moved to the start of the next business day (if $checktime is nonzero) or the next business day at the current time.
      • 📅 Then, if $off > 0, the day $off work days from now is determined.

      📝 Note: for prev_business_day, if the $date check fails, the date is set to the next business date (not previous) — so day 0 is the next business day if $date is not a business day.

      Therefore, the following two calls always give the same result:

      $date->next_business_day(0 [,$checktime]);
      $date->prev_business_day(0 [,$checktime]);

      📝 parse

      $err = $date->parse($string [,@opts]);

      Parses a string which should include a valid date and stores it in the object. If the string does not include a valid date, an error is returned. Use the err method to see the full error message.

      A full date may include a calendar date (year, month, day), a time of day (hour, minute, second), and time zone information. All can be entered in many formats.

      For information on valid date formats, refer to the section VALID DATE FORMATS. For valid time zones, refer to VALID TIME ZONE FORMATS.

      • 🌐 If no time zone info is included, treated as local time zone.
      • 🕓 If time zone info is included, the date will be kept in that time zone; use convert to change it.
      • 🔤 All strings are case insensitive.
      • 📅 When a part is missing, defaults are used (see "Complete vs. truncated" section below).
      • 🔢 Year may be 2 or 4 digits; conversion to 4-digit year depends on the YYtoYYYY config variable.
      • ✔️ Dates are always checked for validity.

      Additional arguments act as options to improve parsing speed:

      noiso8601   Do not try to parse the
                  date as an ISO 8601 date
                  or time.
      nodow       Do not try to parse a
                  day-of-week (Monday) in
                  the string.
      nocommon    Do not try to parse the
                  date using the formats
                  in the "Common date
                  formats" section.
      noother     Do not try to parse the
                  date using the "Less common
                  date formats" or a time
                  using the "Other time
                  formats".
      nospecial   Do not try to parse the
                  date using the "Special
                  date strings" formats
                  or a time using the
                  "Special time strings"
                  formats, or as a
                  combined date/time using
                  the "Additional combined
                  date and time" formats.
      nodelta     Do not treat deltas as
                  a date relative to now.
      noholidays  Do not parse holiday
                  names as dates.

      📅 parse_date

      $err = $date->parse_date($string [,@opts]);

      Parses a string containing a valid date and sets the date part of the object. If the object contained a valid date, the time is kept unchanged. If not, 00:00:00 is used.

      @opts can be any of the strings described in the parse method above.

      🕐 parse_time

      $err = $date->parse_time($string [,@opts]);

      Parses a string and sets the time portion of $date. If a valid date exists in the object, the Y/M/D portion is unchanged. Otherwise, current date is used.

      @opts can be 'noiso8601' or 'noother'.

      🔍 parse_format

      $err          = $date->parse_format($format,$string);
      ($err,%match) = $date->parse_format($format,$string);

      Parses a date contained in $string based on explicit format information in $format. $format is a string containing a regular expression with printf-style directives.

      • ❌ If format invalid: $err contains an error message.
      • 🔎 If format valid but string doesn't match: error code 1.
      • 📋 In array context: returns hash containing %+ (useful if format has named capture groups).

      Directives available are identical to printf directives (e.g., %Y matches a 4-digit year), with caveats:

      %l        NOT available.
      %b,%h,%B  All match a month name/abbreviation.
      %v,%a,%A  All match a day name/abbreviation.
      %z,%Z,%N  Match any time zone string.
      %n        Multi-line matching is NOT supported.
      %x        Format conversion is cached, so the DateFormat
                config variable must be set BEFORE a format
                string containing %x is used.

      The format string may not over-specify the date (e.g., cannot include both %y and %Y).

      📋 Valid format string required+optional fields:

      • M D H Mn S (with optional Y, Zone, Day-of-week)
      • M D H Mn (with optional Y, Zone, Day-of-week)
      • M D (with optional Y, Zone, Day-of-week)
      • H Mn S (with optional Zone)
      • H Mn (with optional Zone)

      📝 Example: parsing a date stored as YYYY.MM-DD:

      $date->parse_format('%Y\\.%m\\-%d',$string);

      📝 Example: extracting date from an Apache log line:

      $date->parse_format('.*?\\[%d/%b/%Y:%T %z\\].*',$line);

      For months, days, hours, you may use %m/%f, %d/%e, %H/%k respectively. The first must be 2-digit; the second accepts 1- or 2-digit (always safe).

      You may use capture groups in your format string. Mix of numbered and named groups works, but you'll need to track them. Internal named capture groups used:

      • y, m, d, h, mn, s
      • mon_name, mon_abb
      • dow_name, dow_abb, dow_char, dow_num
      • doy, nth, ampm
      • epochs, epocho
      • tzstring, off, abb, zone
      • g, w, l, u

      ⚠️ Recommendation: any additional named capture groups should start with a capital letter.

      📝 Example using custom named groups:

      $string = "before 2014-01-25 after";
      ($err,%m) = $date->parse_format('(?<PRE>.*?)%Y-%m-%d(?<POST>.*)',$string);

      Returns hash with: 'PRE' => 'before ', 'POST' => ' after'

      ⏪ prev / ⏩ next

      $err = $date->prev($dow, $curr [,$time]);
      $err = $date->next($dow, $curr [,$time]);

      The prev method changes the date to the previous (or current) occurrence of a day of the week, time of day, or both. The next method is identical in operation but finds the next occurrence.

      🎯 Three $curr values:

      • 🔢 $curr = 0: Look for previous occurrence of day of week; set time to $time or current time.
      • 🔢 $curr = 1: Look for current or previous occurrence; if same day, date remains unchanged.
      • 🔢 $curr = 2: Look for the last time (not counting now) the day of week at the given time occurred. Date may be the same as original.

      $time may be a list reference of [H,MN,S], [H,MN], or [H].

      📝 Examples (Original Date = Fri Nov 22 18:15:00):

      dowcurrtimenew date
      4 (Thu)0/1/2undefThu Nov 21 00:00:00
      40/1/2[12,30,0]Thu Nov 21 12:30:00
      5 (Fri)0/2undefFri Nov 15 18:15:00
      51undefFri Nov 22 18:15:00
      50[12,30,0]Fri Nov 15 12:30:00
      51/2[12,30,0]Fri Nov 22 12:30:00
      50/2[19,30,0]Fri Nov 15 19:30:00
      51[19,30,0]Fri Nov 22 19:30:00

      The second way to use this method is to pass undef for the day of week:

      $err = $date->prev(undef,$curr,$time);

      A time is required and must be a list reference of 3 elements: [H, MN, S]. Any or all elements may be undef.

      📝 Examples (DATE = Fri Nov 22 18:15:00):

      currhrminsecreturns
      0/118undefundefNov 22 18:00:00
      0/118300Nov 21 18:30:00
      01815undefNov 21 18:15:00
      11815undefNov 22 18:15:00
      0undef15undefNov 22 17:15:00
      1undef15undefNov 22 18:15:00

      🖨️ printf

      $out = $date->printf($in);
      @out = $date->printf(@in);

      Takes a string or list of strings which may contain any number of special formatting directives. They are replaced with info from the date; everything else is returned unmodified.

      Directives always begin with %. They are described in the PRINTF DIRECTIVES section.

      ⏰ secs_since_1970_GMT

      $secs = $date->secs_since_1970_GMT();

      Returns the number of seconds elapsed since Jan 1, 1970 00:00:00 GMT (negative if earlier).

      Reverse is also allowed:

      $err = $date->secs_since_1970_GMT($secs);

      Sets the date to $secs seconds from Jan 1, 1970 00:00:00 GMT in the local time zone.

      ⚙️ set

      $err = $date->set($field,@vals [,$isdst]);

      Explicitly sets one or more fields in a date. $field can be:

      • zone[ZONE]: zone name, alias, or offset
      • zdate[ZONE,]DATE: sets zone and entire date
      • dateDATE: sets entire date (zone unchanged)
      • timeTIME: sets entire time
      • yYEAR: set year only
      • mMONTH: set month only
      • dDAY: set day only
      • hHOUR: set hour only
      • mnMINUTE: set minute only
      • sSECOND: set second only

      Where DATE is a list reference [Y,M,D,H,MN,S] and TIME is a list reference [H,MN,S].

      ZONE is optional (defaults to local zone). An optional $isdst (0 or 1) disambiguates DST situations.

      ⚠️ When setting zone: no conversion is done — the date/time stays the same numerically but now refers to the new time zone.

      📤 value

      $val = $date->value([$type]);
      @val = $date->value([$type]);

      Returns the value of the date stored in the object. In scalar context: printable string YYYYMMDDHH:MN:SS. In list context: (Y,M,D,H,MN,S).

      • 🌐 $type omitted: date in parsed time zone.
      • 🏠 $type = "local": local time zone.
      • -windows $type = "gmt": GMT time zone.

      Empty string/list returned on error (with error code set).

      📅 week_of_year

      $wkno = $date->week_of_year([$first]);

      Figures out the week number. If $first is passed in (1-7), refers to the first day of the week. If not, the FirstDay config variable is used.

      ⚠️ This routine should only be called in rare cases. Use printf with the %W, %U, %J, %L formats instead. Returns 0-53 which must be "fixed" for ISO 8601 weeks (1-53). A 0 actually belongs to last week of previous year; a 53 may belong to first week of next year.

      ⚠️ ISSUES WITH PARSING DATES

      The following issues may occur when parsing dates that should be understood to make full use of this module.

      📆 Complete vs. Truncated Dates and Times

      Date formats are either complete or truncated. A complete date fully specifies year, month, day and a complete time fully specifies hour, minute, second.

      It should be understood that in many instances, information may be implied rather than explicitly stated, but it is still treated as complete. For example, the date "January 3" is complete because it implies the current year.

      A truncated calendar date or time does not include information about some fields. Date::Manip never works with a partial date or time, so defaults will be supplied.

      • 📅 The date "2009-01" is missing a day field — day defaults to 1st (equivalent to Jan 1st 2009). If only the year is given, defaults to Jan 1.
      • 🕐 If time or any component is missing, they default to 00. So "12:30" and "12:30:00" are equivalent.

      The complete method can be used to check what type of date was parsed, and which values were specified vs. defaulted. There is no way to differentiate between explicit and implied.

      A string with a date and/or time may consist of any of the following:

      • ✔️ A complete date and a time (complete or truncated)
      • ✔️ A truncated date with no time
      • ✔️ A time (complete or truncated) with no date

      ❌ The date "Jan 2009 12:30" is not valid since it consists of a time with a truncated date.

      🌍 VALID TIME ZONE FORMATS

      Time zone can be specified in three ways: actual time zone name, valid abbreviation, or offset (with optional abbreviation).

      📍 The timezone information always follows the time immediately, and may only be included if a time is included.

      🏷️ By complete name (or alias)

      2001-07-01-00:00:00 America/New_York

      Although unambiguous for determining the time zone, the time is ambiguous in most zones for one hour of the year (when clocks fall back).

      For example, in America/New_York on Sun, Nov 2, 2008, at 02:00 the clock was set back to 01:00. So Nov 2, 2008 at 01:30 is ambiguous.

      📝 This form is discouraged: ambiguous times default to standard time, losing ~1 hour per year of expressibility.

      🏷️ By abbreviation

      2001-07-01-00:00:00 EDT

      This is the most common way. Unfortunately, abbreviations do not uniquely determine the time zone in most cases. Date::Manip will refer to a list of all time zones using the abbreviation and test them in order from Date::Manip::Zones documentation. The first match (where the date/time and abbreviation are valid) determines the zone.

      Although the zone is ambiguous, the date is not — only zones for which the date is valid are used.

      📐 By offset (with optional abbreviation)

      2001-07-01-00:00:00 -04
      2001-07-01-00:00:00 -0400
      2001-07-01-00:00:00 -040000
      2001-07-01-00:00:00 -04:00
      2001-07-01-00:00:00 -04:00:00
      
      2001-07-01-00:00:00 -04 (EDT)
      2001-07-01-00:00:00 -0400 (EDT)
      2001-07-01-00:00:00 -040000 (EDT)
      2001-07-01-00:00:00 -04:00 (EDT)
      2001-07-01-00:00:00 -04:00:00 (EDT)
      
      2001-07-01-00:00:00 -04 EDT
      2001-07-01-00:00:00 -0400 EDT
      2001-07-01-00:00:00 -040000 EDT
      2001-07-01-00:00:00 -04:00 EDT
      2001-07-01-00:00:00 -04:00:00 EDT

      The offset is rarely sufficient to uniquely determine the time zone (offset + abbreviation together is probably sufficient). The time zone is found by testing all zones with the given offset (and abbreviation, if provided). See def_zone in Date::Manip::TZ documentation.

      📅 VALID DATE FORMATS

      Several categories of date formats supported by Date::Manip specify only year/month/day fields. They explicitly set the date, not the time. Combine with a time string to set both, or use the DefaultTime config variable.

      🔢 ISO 8601 Dates

      The preferred date formats are those specified by ISO 8601. Date::Manip handles all formats but doesn't require rigid adherence (the goal is to handle dates as represented in real life).

      A calendar date includes the following fields:

      • CC — 2-digit century
      • YY — 2-digit year in century
      • MM — 2-digit month
      • DD — 2-digit day of month
      • DoY — 3-digit day of year (001-366)
      • Www — character "W" followed by 2-digit week (01-53)
      • D — day of week (1-7)

      📋 Complete date formats (example Thu Mar 5 2009, day 64, Thu=4, week=10):

      FormatNotesExamples
      CCYYMMDD20090305
      CCYY-MM-DD2009-03-05
      YYMMDD1,2,4090305
      YY-MM-DD09-03-05
      -YYMMDD3,4-090305
      -YY-MM-DD-09-03-05
      --MMDD1--0305
      --MM-DD--03-05
      ---DD1---05
      CCYYDoY2009064
      CCYY-DoY2009-064
      YYDoY1,409064
      YY-DoY09-064
      -YYDoY3,4-09064
      -YY-DoY-09-064
      -DoY1-064
      CCYYWwwD2009W104
      CCYY-Www-D2009-W10-4
      YYWwwD1,409W104
      YY-Www-D09-W10-4
      -YYWwwD3,4-09W104
      -YY-Www-D-09-W10-4
      -YWwwD1-9W104
      -Y-Www-D-9-W10-4 (year 0-9 in current decade)
      -WwwD1-W104
      -Www-D-W10-4
      -W-D1-W-4 (D is 1-7 in current week)
      ---D1---4 (same as -W-D)

      📋 Truncated date formats:

      FormatNotesExamples
      CCYY-MM22009-03 (2009-03-01)
      CCYY2009 (2009-01-01)
      CC220 (2000-01-01)
      -YYMM4-0903
      -YY-MM-09-03
      -YY4-09
      --MM--03
      CCYYWww2009W10
      CCYY-Www2009-W10
      YYWww409W10
      YY-Www09-W10
      -YYWww3,4-09W10
      -YY-Www-09-W10
      -Www-W10

      📝 Notes:

      1. These formats are considered truncated in the standard, but since they include (or imply, using current date for defaults) all fields, and don't introduce parsing complexities, the standard is relaxed — they are treated as complete.
      2. These formats are treated differently than in Date::Manip 5.xx as described below.
      3. Not defined in ISO 8601 spec, but added for completeness since they don't add parsing incompatibilities.
      4. Formats where century is not given are described in the spec as a year in the current century. Date::Manip treats this more generically using the YYtoYYYY config variable.

      Date::Manip 5.xx handled ISO 8601 dates less rigidly. As of 6.00:

      • 🔢 A two-digit date will be treated as CC. Previously, it was treated as YY.
      • 🔢 A six-digit date will be treated as YYMMDD. Previously, YYYYMM.
      • 📐 Dashes were optional in many cases previously. Now dates must be in expanded (all dashes) or abbreviated (no dashes) form. YYMMDD and YY-MM-DD are allowed; YY-MMDD is NOT.

      The Www-D formats: e.g., 1996-w02-3 refers to day with ordinal number 3 within calendar week in the 2nd week of 1996. Days numbered 1-7 (Mon-Sun). As of 6.00, this is interpreted as the 3rd day of the 2nd week (a reversal from 5.xx). See Date::Manip::Changes.

      📅 Common Date Formats

      Date::Manip supports many common date formats. Fields may include:

      • YY — 2-digit year
      • YYYY — 4-digit year
      • M — 1- or 2-digit month
      • MM — 2-digit month
      • D — 1- or 2-digit day
      • DD — 2-digit day
      • mmm — abbreviated or full month name

      Supported formats:

      FormatNotesExamples
      M/D1,2,33/5
      M/D/YY13/5/09
      M/D/YYYY13/5/2009
      YYYY/M/D2009/3/5
      mmm/DMar/5
      mmm/D/YYMar/5/09
      mmm/D/YYYYMar/5/2009
      D/mmm5/Mar
      D/mmm/YY5/Mar/09
      D/mmm/YYYY5/Mar/2009
      YYYY/mmm/D2009/Mar/5
      mmmDMar5
      mmmDDYY4Mar0509
      mmmDDYYYYMar052009
      Dmmm5Mar
      DmmmYY5Mar09
      DmmmYYYY5Mar2009
      YYYYmmmD2009Mar5
      mmmD YYMar5 09
      mmmD YYYYMar5 2009
      Dmmm YY5Mar 09
      Dmmm YYYY5Mar 2009
      mmm/D YYMar/5 09
      mmm/D YYYYMar/5 2009
      D/mmm YY5/Mar 09
      D/mmm YYYY5/Mar 2009
      YY mmmD09 Mar5
      YYYY mmmD2009 Mar5
      YY Dmmm09 5Mar
      YYYY Dmmm2009 5Mar
      YY mmm/D09 Mar/5
      YYYY mmm/D2009 Mar/5
      YY D/mmm09 5/Mar
      YYYY D/mmm2009 5/Mar
      YYYY:MM:DD2010:01:15 (EXIF format)
      mmmYYYY4Jun 2010
      YYYYmmm42010 June
      mmm/YYYY4Jun/2010
      YYYY/mmm42010/Jun

      📝 The separator (/) can be replaced by: whitespace, slash (/), period (.), or dash (-). The dash is discouraged since it may conflict with ISO 8601. Use the same separator throughout (e.g., MM/DD.YY is NOT valid).

      1. Americans typically write month first; other countries write day first. The latter can be obtained by setting the config variable DateFormat to something other than "US".
      2. The dot (.) separator may NOT be used in M/D format since it will be interpreted as the H12,H+ format.
      3. The M/D format should not use period (.) separator.
      4. Historical lack of support for partial dates; new config variable Format_MMMYYYY changes this. Without it: only mmmDDYY allowed. With it: mmmYYYY and YYYYmmm allowed.

      If Format_MMMYYYY is set to 'first', the result is the 1st of the month at midnight; if 'last', the last day at 23:59:59.

      📅 Less Common Date Formats

      The following formats are also supported:

      • 📌 DoW: The day of week of the current week
        • Friday
        • Friday at 12:40
      • 📌 Nth occurrence of month:
        • MMM Nth [YYYY]
        • Nth MMM [YYYY]
        • YYYY MMM Nth
        • YYYY Nth MMM

        Example: Dec 1st 1970, 1970 Dec 1st

      • 📌 next/prev DoW: The next or last occurrence of DoW
        • next Friday
        • last Friday at 12:40
      • 📌 next/last week/month/year: A day one week/month/year from now or in the past
        • next week
        • last month at 15:00
      • 📌 last day in MMM [YYYY]: Last day of the month
        • last day in October
        • last day in October 1996
      • 📌 last DoW in MMM [YYYY]: Last DoW in the month
        • last Tuesday in October
        • last Tuesday in October 1996
      • 📌 last DoW in YYYY: Last DoW in the year
        • last Tuesday in 1997

        ⚠️ NOTE: "last DoW" doesn't work in English since "last" is used for both this and "prev DoW" (which is parsed first). MAY work in other languages.

      • 📌 Nth DoW in MMM [YYYY]: Nth DoW in the month
        • 3rd Tuesday in October
      • 📌 Nth DoW [YYYY]: Nth DoW in the year
        • 22nd Sunday
        • 22nd Sunday in 1996
      • 📌 Nth day in MMM [YYYY]: Nth day of the month
        • 1st day of February
      • 📌 DoW week: British: same as "in 1 week on DoW"
        • Monday week
      • 📌 DoW week N / Nth week [YYYY]: DoW of Nth week of year
        • Sunday week 22
        • Sunday 22nd week
      • 📌 Nth: Nth day of the current month
        • 12th

      📝 Note: "Sunday week 22" and "22nd Sunday" give different behaviors. "Sunday week 22" returns the Sunday of the 22nd week of the year based on how week 1 is defined (ISO 8601: week one contains Jan 4). "22nd Sunday" gives the actual 22nd Sunday in a year.

      ✨ Special Date Strings

      Most languages have strings for dates relative to today. In English:

      • today
      • tomorrow
      • yesterday

      British formats:

      • today week
      • tomorrow week
      • yesterday week

      These refer to one week after today/tomorrow/yesterday. Other languages have similar strings.

      🎉 Holidays

      You can parse holiday names as dates (including time zones). For example:

      Christmas
      Christmas 2010
      Christmas 2010 at noon
      Christmas 2010 at noon PST
      Saturday Christmas 2010 at noon

      📝 In all formats (except ISO 8601), the day of week ("Friday") can be entered anywhere in the date and will be checked for accuracy. So "Tue Jul 16 1996 13:17:00" works, but "Jul 16 1996 Wednesday 13:17:00" does not (Jul 16, 1996 was Tuesday, not Wednesday).

      🌐 A NOTE ABOUT FOREIGN LANGUAGE DATES

      Although Date::Manip has some support for parsing dates in foreign languages, the formats supported are largely based on English equivalents.

      There are probably many dates that are valid and common in other languages but don't have an English equivalent, and Date::Manip will probably not parse these.

      You may submit these to the author — but no guarantee. Without a full language parser, most of these formats will simply not be supportable.

      🕐 VALID TIME FORMATS

      Several categories of time formats supported by Date::Manip specify only hour/minute/second fields.

      🔢 ISO 8601 Times

      A time may be complete or truncated. Again, Date::Manip treats some formats as complete even though the standard calls them truncated.

      A time may include:

      • HH — 2-digit hour
      • MN — 2-digit minutes
      • SS — 2-digit seconds
      • H+ — 1+ digit fractional hours
      • M+ — 1+ digit fractional minutes
      • S+ — 1+ digit fractional seconds

      📋 Complete time formats (example 12:30:15):

      FormatNotesExamples
      HHMNSS2123015
      HH:MN:SS12:30:15
      HHMNSS,S+123015,5
      HH:MN:SS,S+12:30:15,5 (fractional sec ignored)
      HHMN,M+1230,25 (12:30:00 + 0.25 min)
      HH:MN,M+12:30,25
      HH,H+12,5 (12:00 + 0.5 hr = 12:30:00)
      -MNSS1-3015
      -MN:SS-30:15
      --SS1--15
      -MNSS,S+1-3015,5
      -MN:SS,S+-30:15,5
      -MN,M+1-30,25
      --SS,S+1--5
      HHMN31230
      HH:MN12:30

      📋 Truncated time formats:

      • HH — e.g., 12
      • -MN — e.g., -30

      📝 Notes:

      1. Truncated per the standard but relaxed to complete since they include (or imply) all fields.
      2. The HHMNSS format will not be correctly parsed since it's impossible to distinguish from YYMMDD. Append ",0" to force time interpretation or include time zone info (name/abbreviation; offset won't work).
      3. The HH:MN format will be treated as complete even though it's incomplete due to missing seconds. It might include time zone info.

      📝 ISO 8601 times may be followed by a time zone (unless truncated). Truncated times may NOT include a timezone. Date::Manip relaxes constraints and allows any method (name, abbreviation, or offset). Time zone may be separated by space (not required).

      📝 Fractional parts may use a period: 12:30,25 and 12:30.25 are equivalent.

      ⚠️ Using a negative time zone offset may cause confusion. Example: 123005-0300 may not be parsed correctly. Use colons in time when using offset time zones: 12:30:05-0300

      🕐 Other Time Formats

      A time may include:

      • H24 — 1- or 2-digit hour (0-23)
      • H12 — 1- or 2-digit hour (1-12)
      • MN — 2-digit minutes
      • SS — 2-digit seconds
      • H+ — 1+ digit fractional hours
      • M+ — 1+ digit fractional minutes
      • S+ — 1+ digit fractional seconds
      • AM — language-specific AM/PM

      📋 Accepted formats:

      FormatExamples
      H24:MN:SS17:30:15
      H12:MN:SS AM5:30:15 PM
      H24:MN:SS,S+17:30:15,5
      H12:MN:SS,S+ AM5:30:15,5 PM
      H24:MN,M+17:30,25 (17:30:00 + 0.25 min)
      H12,M+ AM5:30,25 PM
      H24,H+17,5 (17:00 + 0.5 hr)
      H12,H+ AM5,5 PM (12:30 equivalent)
      H24:MN17:30
      H12:MN AM5:30 PM
      H12 AM5 PM

      📝 Fractional part may use comma, period, or colon. For example, 12:30:20,25, 12:30:20.25, 12:30:20:25 are equivalent.

      📝 Some languages have alternate separators (e.g., French uses h for H:MN): 12:30:00 = 12h30:00.

      📝 Time zone info can follow time (space-separated or adjacent).

      ✨ Special Time Strings

      Different languages may have words specifying a certain time of day. In English:

      • noon12:00:00
      • midnight00:00:00

      So "Jan 2 2009 at noon" is equivalent to "Jan 2 2009 12:00:00".

      📝 Two possible interpretations of midnight: at start of day (00:00:00) or end of day (24:00:00 = 00:00:00 of next day). The first is used for backwards compatibility with 5.xx.

      📝 In most languages, a word similar to "at" may precede the time (except ISO 8601). The following are equivalent: 12:30 vs at 12:30.

      📝 Date::Manip uses these conventions:

      • midnight = 12:00am = 00:00:00
      • noon = 12:00pm = 12:00:00

      Day goes from 00:00:00 to 23:59:59. Midnight is the beginning of a day, not the end. The time 24:00:00 is allowed (auto-transformed to 00:00:00 of next day). So "Wed Feb 8 2006 24:00:00" gives "Thu Feb 9 2006 00:00:00".

      🔗 VALID COMBINED DATE AND TIME FORMATS

      Several categories of strings specify both date and time.

      🔢 ISO 8601 Combined Date and Time

      A combined ISO 8601 date and time is a string containing a complete ISO 8601 date and a complete or truncated ISO 8601 time. May include a timezone if a complete time is included.

      Date::Manip relaxes restrictions on combination. Time may be separated from date by space, dash, or letter T, or joined with no separator.

      • 📍 When time immediately follows date (or separated by dash), the resulting string MUST be unambiguous.
      • 🗓️ DoY formats should always be separated from time.
      • 🕐 Time zone info may immediately follow a complete time, with optional whitespace separator.

      🌍 Non-ISO 8601 Combined Date and Time

      A date from any non-ISO 8601 format may be combined with any non-ISO 8601 time format in any combination.

      ➕ Deltas

      Dates are often specified as a delta from "now". Most valid deltas can be used. Refer to the Date::Manip::Delta documentation.

      If the delta doesn't include a time part, time may be specified explicitly:

      in 3 days at 12:00:00
      in 3 days at 12:00:00 PST

      ❌ It is NOT allowed to include explicit time if any time segment was in the delta:

      in 3 days 2 hours at 12:00:00

      📝 One additional format: include only week (or higher) components and set day of week:

      Friday in 2 weeks
      in 2 weeks on Friday
      Friday 2 weeks ago
      2 weeks ago on Friday at 13:45

      These first apply the delta (weeks/months/years) to current time, then set the day to given day-of-week.

      ✨ Special Date and Time Strings

      Most languages have strings for full date and time relative to current. In English: now. May include timezone: now PST.

      ➕ Additional Combined Formats

      epoch SECS
         Number of seconds since the epoch
         (Jan 1, 1970 00:00:00 GMT). SECS may
         be negative for time before epoch.
      or
      epoch SECS TIMEZONE

      📝 Notes:

      • 📍 Commas may be included in all date formats arbitrarily (except ISO 8601, where only when allowed).
      • 🕐 Time/time zone is removed from date before parsing, so time may appear before/after date or between any two parts.
      • 📍 Time and zone don't need to be adjacent: "Jan 21 17:13:27 2010 -0400" works. If timezone is separate from date, it MUST be separated by whitespace.
      • 🔤 Words like "on", "in", "at", "of" commonly in dates are ignored (except ISO 8601).

      🖨️ PRINTF DIRECTIVES

      The following printf directives are replaced with information from the date.

      📆 Year

      • %y — year (00 to 99)
      • %Y — year (0001 to 9999)

      🗓️ Month, Week

      • %m — month of year (01 to 12)
      • %f — month of year (" 1" to "12")
      • %b, %h — month abbreviation (Jan to Dec)
      • %B — month name (January to December)

      📅 Day

      • %j — day of year (001 to 366)
      • %d — day of month (01 to 31)
      • %e — day of month (" 1" to "31")
      • %v — weekday abbreviation (" S"," M"," T", …)
      • %a — weekday abbreviation (Sun to Sat)
      • %A — weekday name (Sunday to Saturday)
      • %w — day of week (1 to 7, 1=Monday)
      • %E — day of month with suffix (1st, 2nd, 3rd…)

      🕐 Hour

      • %H — hour (00 to 23)
      • %k — hour (" 0" to "23")
      • %i — hour (" 1" to "12")
      • %I — hour (01 to 12)
      • %p — AM or PM

      ⏱️ Minute, Second, Time Zone

      • %M — minute (00 to 59)
      • %S — second (00 to 59)
      • %Z — time zone abbreviation (EDT)
      • %z — time zone as GMT offset (+0100)
      • %N — time zone as GMT offset (+01:00:00)

      ⏳ Epoch

      • %s — seconds from 1/1/1970 GMT (negative if before)
      • %o — seconds from 1/1/1970 in current time zone

      🕓 Date, Time

      • %c%a %b %e %H:%M:%S %Y → Fri Apr 28 17:23:15 1995
      • %C, %u%a %b %e %H:%M:%S %Z %Y → Fri Apr 28 17:25:57 EDT 1995
      • %g%a, %d %b %Y %H:%M:%S %Z → Fri, 28 Apr 1995 17:23:15 EDT
      • %D%m/%d/%y → 04/28/95
      • %x%m/%d/%y or %d/%m/%y (depends on DateFormat)
      • %l — date in ls(1) format (%b %e %H:%M or %b %e %Y)
      • %r%I:%M:%S %p → 05:39:55 PM
      • %R%H:%M → 17:40
      • %T, %X%H:%M:%S → 17:40:58
      • %V%m%d%H%M%y → 0428174095
      • %Q%Y%m%d → 19961025
      • %q%Y%m%d%H%M%S → 19961025174058
      • %P%Y%m%d%H:%M:%S → 1996102517:40:58
      • %O%Y-%m-%dT%H:%M:%S → 1996-10-25T17:40:58
      • %F%A, %B %e, %Y → Sunday, January 1, 1996
      • %K%Y-%j → 1997-045

      📆 Special Year/Week Formats

      • %G — year, Monday as first day of week (0001 to 9999)
      • %W — week of year, Monday as first day (01 to 53)
      • %L — year, Sunday as first day of week (0001 to 9999)
      • %U — week of year, Sunday as first day (01 to 53)
      • %J%G-W%W-%w → 1997-W02-2

      🔤 Other Formats

      • %n — insert newline
      • %t — insert tab
      • %% — insert %
      • %+ — insert +

      📝 All other characters currently unused (insert char following %).

      🔧 Extended Formats

      • %<A=NUM> — returns NUMth value of %A, %a, %v. NUM must be 1-7. (English: %<A=2> → Tuesday)
      • %<a=NUM> — single-letter weekday name (English: %<a=2> → Tue)
      • %<v=NUM> — single-character weekday (English: %<v=2> → T)
      • %<B=NUM> — NUMth value of %B. NUM must be 1-12. (English: %<B=2> → February)
      • %<b=NUM> — month abbreviation (English: %<b=2> → Feb)
      • %<p=NUM> — AM/PM NUM. NUM 1-2. (English: %<p=1> → AM)
      • %<E=NUM> — day-of-month suffix NUM. NUM 1-53. (English: %<E=1> → 1st)

      📝 If a lone percent is the final character in a format, it is ignored.

      📝 Format directives were originally based on date.pl v3.2 by Terry McGonigal, plus some from Solaris date(1), plus several unique to Date::Manip.

      📌 NOTE 1 — The ls format (%l) applies to dates within past OR future 6 months. Dates before NOW − 6 months or on/after NOW + 6 months will have year printed. The later time must be on/after to avoid ambiguity. Example: if now is 2000-06-06-12:00:00, then 1999-12-06-12:00:00 → "Dec 6 12:00" but 2000-12-06-12:00:00 → "Dec 6 2000".

      📌 NOTE 2%U, %W, %L, %G, %J support ISO-8601 YYYY-wWW-D. A date is year/week of year/day of week. Sunday and Monday as start are both supported.

      • %W and %G treat weeks starting on Monday.
      • %U and %L treat weeks starting on Sunday.
      • %L and %G usually match %Y, but days in first/last week may belong to previous/next year. Week assigned to year with most days. Example: if week starts Sunday, last week of 2003 is 2003-12-28 to 2004-01-03 → assigned to 2003 (4 days vs 3).
      • Use (%W, %G) or (%U, %L) combinations. %Y may give incorrect results.
      • %J returns full ISO-8601 format (%G-W%W-%w).

      📌 NOTE 3%s and %o return negative values if date is before epoch. Other Unix utilities would return an error/zero; check for negative value when interoperating.

      📌 NOTE 4%z returns RFC 822 format +0500. Most offsets are full-hour amounts. Some are irregular (+05:17:30); in this case it returns +051730 which isn't RFC 822 compliant, but since RFC 822 ignores this situation, the second option was chosen (returning the value anyway).

      🐛 KNOWN BUGS

      None known.

      ❓ BUGS AND QUESTIONS

      Please refer to the Date::Manip::Problems documentation for information on submitting bug reports or questions to the author.

      🔗 SEE ALSO

      📜 LICENSE

      This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

      👤 AUTHOR

      Sullivan Beck (sbeck AT cpan.org)

      perl v5.32.1 — 2021-11-20 — Date::Manip::Date(3pm)

      ``` Wait, I have a small issue with my Quick Reference. Let me double-check the character count. This document is quite long. Let me try to estimate... probably around 60-80K characters. Should fit easily. Let me also check XSS one more time: - I escaped `%` to `%<...>` ✓ - I escaped `` (already in original as `<=>`) ✓ - `

  • Date::Manip::Date
    📛 NAME 🚀 Quick Reference 📋 SYNOPSIS 📖 DESCRIPTION 🔧 METHODS 📛 NAME 🚀 Quick Reference 🔧 METHODS 📛 NAME 📛 NAME 🚀 Quick Reference 📋 SYNOPSIS 📖 DESCRIPTION 🔧 METHODS ⚠️ ISSUES WITH PARSING DATES 🌍 VALID TIME ZONE FORMATS 📅 VALID DATE FORMATS 🌐 A NOTE ABOUT FOREIGN LANGUAGE DATES 🕐 VALID TIME FORMATS 🔗 VALID COMBINED DATE AND TIME FORMATS 🖨️ PRINTF DIRECTIVES 🐛 KNOWN BUGS ❓ BUGS AND QUESTIONS 🔗 SEE ALSO 📜 LICENSE 👤 AUTHOR

    Generated by phpman v4.10.0-7-g98e9fd5 Author: Che Dong Under GNU General Public License
    2026-09-07 09:10 @2600:1f28:365:80b0:d222:ca63:50d7:f9b2
    CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
    Valid XHTML 1.0 Transitional!Valid CSS!