Date::Parse - Online Linux Manual PageSection : 3
Updated : 2022-01-21
Source : perl v5.34.0
Note : User Contributed Perl Documentation

NAMEDate::Parse − Parse date strings into time values

SYNOPSIS​ use Date::Parse; ​ ​ $time = str2time($date); ​ ​ ($ss,$mm,$hh,$day,$month,$year,$zone) = strptime($date);

DESCRIPTIONDate::Parse provides two routines for parsing date strings into time values. str2time(DATE [, ZONE]) str2time parses DATE and returns a unix time value, or undef upon failure. ​ZONE, if given, specifies the timezone to assume when parsing if the date string does not specify a timezone. strptime(DATE [, ZONE]) strptime takes the same arguments as str2time but returns an array of values ($ss,$mm,$hh,$day,$month,$year,$zone,$century). Elements are only defined if they could be extracted from the date string. The $zone element is the timezone offset in seconds from GMT. An empty array is returned upon failure.

MULTI-LANGUAGE SUPPORTDate::Parse is capable of parsing dates in several languages, these include English, French, German and Italian. ​ $lang = Date::Language−>new('German'); ​ $lang−>str2time("25 Jun 1996 21:09:55 +0100");

EXAMPLE DATESBelow is a sample list of dates that are known to be parsable with Date::Parse ​ 1995:01:24T09:08:17.1823213 ISO−8601 ​ 1995−01−24T09:08:17.1823213 ​ Wed, 16 Jun 94 07:29:35 CST Comma and day name are optional ​ Thu, 13 Oct 94 10:13:13 −0700 ​ Wed, 9 Nov 1994 09:50:32 −0500 (EST) Text in ()'s will be ignored. ​ 21 dec 17:05 Will be parsed in the current time zone ​ 21−dec 17:05 ​ 21/dec 17:05 ​ 21/dec/93 17:05 ​ 1999 10:02:18 "GMT" ​ 16 Nov 94 22:28:20 PST

LIMITATIONDate::Parse uses Time::Local internally, so is limited to only parsing dates which result in valid values for Time::Local::timelocal. This generally means dates between 1901−12−17 00:00:00 GMT and 2038−01−16 23:59:59 GMT

BUGSWhen both the month and the date are specified in the date as numbers they are always parsed assuming that the month number comes before the date. This is the usual format used in American dates. The reason why it is like this and not dynamic is that it must be deterministic. Several people have suggested using the current locale, but this will not work as the date being parsed may not be in the format of the current locale. My plans to address this, which will be in a future release, is to allow the programmer to state what order they want these values parsed in.

AUTHORGraham Barr <gbarr@pobox.com>

COPYRIGHTCopyright (c) 1995−2009 Graham Barr. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
0
Johanes Gumabo
Data Size   :   8,591 byte
man-Date::Parse.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 199,548
Visitor ID   :     :  
Visitor IP   :   18.191.54.190   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Date::Parse.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Date::Parse.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Date::Parse.3pm|43|br══─}─══|'br══─}─══ )         (htmlprn|149|Date::Parse.3pm|43|'br══─}─══ |'br══─}─══ )