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 >
Text File  |  2000-03-23  |  4KB  |  106 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Date::Parse - Parse date strings into time values</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> Date::Parse - Parse date strings into time values</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
  24.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  25.     <LI><A HREF="#multilanguage support">MULTI-LANGUAGE SUPPORT</A></LI>
  26.     <LI><A HREF="#author">AUTHOR</A></LI>
  27.     <LI><A HREF="#copyright">COPYRIGHT</A></LI>
  28. </UL>
  29. <!-- INDEX END -->
  30.  
  31. <HR>
  32. <P>
  33. <H1><A NAME="name">NAME</A></H1>
  34. <P>Date::Parse - Parse date strings into time values</P>
  35. <P>
  36. <HR>
  37. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  38. <UL>
  39. <LI>Linux</LI>
  40. <LI>Solaris</LI>
  41. <LI>Windows</LI>
  42. </UL>
  43. <HR>
  44. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  45. <PRE>
  46.         use Date::Parse;
  47. </PRE>
  48. <PRE>
  49.  
  50.         $time = str2time($date);</PRE>
  51. <PRE>
  52.  
  53.         ($ss,$mm,$hh,$day,$month,$year,$zone) = strptime($date);</PRE>
  54. <P>
  55. <HR>
  56. <H1><A NAME="description">DESCRIPTION</A></H1>
  57. <P><CODE>Date::Parse</CODE> provides two routines for parsing date strings into time values.</P>
  58. <DL>
  59. <DT><STRONG><A NAME="item_str2time">str2time(DATE [, ZONE])</A></STRONG><BR>
  60. <DD>
  61. <A HREF="#item_str2time"><CODE>str2time</CODE></A> parses <CODE>DATE</CODE> and returns a unix time value, or undef upon failure.
  62. <CODE>ZONE</CODE>, if given, specifies the timezone to assume when parsing if the
  63. date string does not specify a timezome.
  64. <P></P>
  65. <DT><STRONG><A NAME="item_strptime">strptime(DATE [, ZONE])</A></STRONG><BR>
  66. <DD>
  67. <A HREF="#item_strptime"><CODE>strptime</CODE></A> takes the same arguments as str2time but returns an array of
  68. values <CODE>($ss,$mm,$hh,$day,$month,$year,$zone)</CODE>. Elements are only defined
  69. if they could be extracted from the date string. The <CODE>$zone</CODE> element is
  70. the timezone offset in seconds from GMT. An empty array is returned upon
  71. failure.
  72. <P></P></DL>
  73. <P>
  74. <HR>
  75. <H1><A NAME="multilanguage support">MULTI-LANGUAGE SUPPORT</A></H1>
  76. <P>Date::Parse is capable of parsing dates in several languages, these are
  77. English, French, German and Italian. Changing the language is done via
  78. a static method call, for example</P>
  79. <PRE>
  80.         Date::Parse->language('German');</PRE>
  81. <P>will cause Date::Parse to attempt to parse any subsequent dates in German.</P>
  82. <P>This is only a first pass, I am considering changing this to be</P>
  83. <PRE>
  84.         $lang = Date::Language->new('German');
  85.         $lang->str2time("25 Jun 1996 21:09:55 +0100");</PRE>
  86. <P>I am open to suggestions on this.</P>
  87. <P>
  88. <HR>
  89. <H1><A NAME="author">AUTHOR</A></H1>
  90. <P>Graham Barr <<A HREF="mailto:Graham.Barr@pobox.com">Graham.Barr@pobox.com</A>></P>
  91. <P>
  92. <HR>
  93. <H1><A NAME="copyright">COPYRIGHT</A></H1>
  94. <P>Copyright (c) 1995-8 Graham Barr. All rights reserved. This program is free
  95. software; you can redistribute it and/or modify it under the same terms
  96. as Perl itself.</P>
  97. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  98. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  99. <STRONG><P CLASS=block> Date::Parse - Parse date strings into time values</P></STRONG>
  100. </TD></TR>
  101. </TABLE>
  102.  
  103. </BODY>
  104.  
  105. </HTML>
  106.