home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_e49fc27e5df4c19fce792b052e108e33
< prev
next >
Wrap
Text File
|
2000-03-23
|
4KB
|
106 lines
<HTML>
<HEAD>
<TITLE>Date::Parse - Parse date strings into time values</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Date::Parse - Parse date strings into time values</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#multilanguage support">MULTI-LANGUAGE SUPPORT</A></LI>
<LI><A HREF="#author">AUTHOR</A></LI>
<LI><A HREF="#copyright">COPYRIGHT</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Date::Parse - Parse date strings into time values</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
use Date::Parse;
</PRE>
<PRE>
$time = str2time($date);</PRE>
<PRE>
($ss,$mm,$hh,$day,$month,$year,$zone) = strptime($date);</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P><CODE>Date::Parse</CODE> provides two routines for parsing date strings into time values.</P>
<DL>
<DT><STRONG><A NAME="item_str2time">str2time(DATE [, ZONE])</A></STRONG><BR>
<DD>
<A HREF="#item_str2time"><CODE>str2time</CODE></A> parses <CODE>DATE</CODE> and returns a unix time value, or undef upon failure.
<CODE>ZONE</CODE>, if given, specifies the timezone to assume when parsing if the
date string does not specify a timezome.
<P></P>
<DT><STRONG><A NAME="item_strptime">strptime(DATE [, ZONE])</A></STRONG><BR>
<DD>
<A HREF="#item_strptime"><CODE>strptime</CODE></A> takes the same arguments as str2time but returns an array of
values <CODE>($ss,$mm,$hh,$day,$month,$year,$zone)</CODE>. Elements are only defined
if they could be extracted from the date string. The <CODE>$zone</CODE> element is
the timezone offset in seconds from GMT. An empty array is returned upon
failure.
<P></P></DL>
<P>
<HR>
<H1><A NAME="multilanguage support">MULTI-LANGUAGE SUPPORT</A></H1>
<P>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</P>
<PRE>
Date::Parse->language('German');</PRE>
<P>will cause Date::Parse to attempt to parse any subsequent dates in German.</P>
<P>This is only a first pass, I am considering changing this to be</P>
<PRE>
$lang = Date::Language->new('German');
$lang->str2time("25 Jun 1996 21:09:55 +0100");</PRE>
<P>I am open to suggestions on this.</P>
<P>
<HR>
<H1><A NAME="author">AUTHOR</A></H1>
<P>Graham Barr <<A HREF="mailto:Graham.Barr@pobox.com">Graham.Barr@pobox.com</A>></P>
<P>
<HR>
<H1><A NAME="copyright">COPYRIGHT</A></H1>
<P>Copyright (c) 1995-8 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.</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Date::Parse - Parse date strings into time values</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>