@node Date/Parse, Des, Date/Manip, Module List
@unnumbered Parse date strings into time values


@unnumberedsec NAME

Date::Parse - Parse date strings into time values

@unnumberedsec SYNOPSIS

@example
use Date::Parse;

$time = str2time($date);

($ss,$mm,$hh,$day,$month,$year,$zone) = strptime($date);
@end example

@unnumberedsec DESCRIPTION

@code{Date::Parse} provides two routines for parsing date strings into time values.

@table @asis
@item str2time(DATE [, ZONE])
@code{str2time} parses DATE and returns a unix time value, or undef upon failure.
@code{ZONE}, if given, specifies the timezone to assume when parsing if the
date string does not specify a timezome.

@item strptime(DATE [, ZONE])
@code{strptime} takes the same arguments as str2time but returns an array of
values @code{($ss,$mm,$hh,$day,$month,$year,$zone)}. Elements are only defined
if they could be extracted from the date string. The @code{$zone} element is
the timezone offset in seconds from GMT. An empty array is returned upon
failure.

@end table
@unnumberedsec MULTI-LANGUAGE SUPPORT

Date::Parse is capable of parsing dates in several languages, these are
English, French, German and Italian. Changing the language is done via
a static method call, for example

@example
Date::Parse->language(@'German@');
@end example

will cause Date::Parse to attempt to parse any subsequent dates in German.

This is only a first pass, I am considering changing this to be

@example
$lang = Date::Language->new(@'German@');
$lang->str2time("25 Jun 1996 21:09:55 +0100");
@end example

I am open to suggestions on this.

@unnumberedsec AUTHOR

Graham Barr <Graham.Barr@@tiuk.ti.com>

@unnumberedsec REVISION

$Revision: 2.5 $

@unnumberedsec COPYRIGHT

Copyright (c) 1995 Graham Barr. All rights reserved. This program is free
software; you can redistribute it and/or modify it under the same terms
as Perl itself.

