cvs: /phpdoc/functions datetime.sgml

From: Date: Thu, 15 Jul 1999 17:04:25 +0000
Subject: cvs: /phpdoc/functions datetime.sgml
Groups: php.dev 
Request: Send a blank email to php-dev+get-8566@lists.php.net to get a copy of this message
eschmid Thu Jul 15 17:04:25 1999 EDT Modified files: /phpdoc/functions datetime.sgml Log: Some enhancements to datetime.sgml Index: phpdoc/functions/datetime.sgml diff -u phpdoc/functions/datetime.sgml:1.9 phpdoc/functions/datetime.sgml:1.10 --- phpdoc/functions/datetime.sgml:1.9 Thu Jul 15 16:24:07 1999 +++ phpdoc/functions/datetime.sgml Thu Jul 15 17:04:25 1999 @@ -91,28 +91,32 @@ <example> <title><function>date</function> example</title> - <programlisting> -print(date( "l dS of F Y h:i:s A" )); -print("July 1, 2000 is on a " . date("l", mktime(0,0,0,7,1,2000))); -</programlisting></example> - <para> - It is possible to use <function>date</function> and - <function>mktime</function> together to find dates in the - future or the past. + <programlisting role="php"> +print (date("l dS of F Y h:i:s A")); +print ("July 1, 2000 is on a " . date("l", mktime(0,0,0,7,1,2000))); + </programlisting> + </example> + <para> + It is possible to use <function>date</function> and + <function>mktime</function> together to find dates in the future + or the past. <example> - <title><function>date</function> and <function>mktime</function> example</title> + <title> + <function>date</function> and <function>mktime</function> example + </title> <programlisting> $tomorrow = mktime(0,0,0,date("m") ,date("d")+1,date("Y")); $lastmonth = mktime(0,0,0,date("m")-1,date("d"), date("Y")); $nextyear = mktime(0,0,0,date("m"), date("d", date("Y")+1); -</programlisting></example> + </programlisting> + </example> </para> <para> - To format dates in other languages, you should use the - <function>setlocale</function> and <function>strftime</function> - functions. + To format dates in other languages, you should use the + <function>setlocale</function> and <function>strftime</function> + functions. </para> <para> @@ -126,7 +130,8 @@ <refentry id="function.strftime"> <refnamediv> <refname>strftime</refname> - <refpurpose>format a local time/date according to locale settings</refpurpose> + <refpurpose>format a local time/date according to locale settings + </refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -171,7 +176,7 @@ <example> <title><function>strftime</function> example</title> - <programlisting> + <programlisting role="php"> setlocale ("LC_TIME", "C"); print(strftime("%A in Finnish is ")); setlocale ("LC_TIME", "fi"); @@ -180,9 +185,10 @@ print(strftime("%A and in German ")); setlocale ("LC_TIME", "de"); print(strftime("%A.\n")); -</programlisting></example> - This example works if you have the respective locales installed - in your system. + </programlisting> + </example> + This example works if you have the respective locales installed + in your system. <para> See also <function>setlocale</function> and @@ -191,7 +197,6 @@ </refsect1> </refentry> - <refentry id="function.gmstrftime"> <refnamediv> <refname>gmstrftime</refname> @@ -211,12 +216,14 @@ "Dec 31 1998 20:00:00", while the second prints "Jan 01 1999 01:00:00". <example> <title><function>gmstrftime</function> example</title> - <programlisting> -setlocale('LC_TIME','en_US'); -echo strftime("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n"; -echo gmstrftime("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n"; -</programlisting></example> - </para><para> + <programlisting role="php"> +setlocale ('LC_TIME','en_US'); +echo strftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n"; +echo gmstrftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n"; + </programlisting> + </example> + </para> + <para> See also <function>strftime</function>. </para> </refsect1> @@ -298,11 +305,13 @@ "Dec 31 1997 22:00:00". <example> <title><function>gmdate</function> example</title> - <programlisting> + <programlisting role="php"> echo date( "M d Y H:i:s",mktime(0,0,0,1,1,1998) ); echo gmdate( "M d Y H:i:s",mktime(0,0,0,1,1,1998) ); -</programlisting></example> - </para><para> + </programlisting> + </example> + </para> + <para> See also <function>date</function>, <function>mktime</function> and <function>gmmktime</function>. </para> @@ -363,8 +372,10 @@ echo date( "M-d-Y", mktime(0,0,0,12,32,1997) ); echo date( "M-d-Y", mktime(0,0,0,13,1,1997) ); echo date( "M-d-Y", mktime(0,0,0,1,1,1998) ); -</programlisting></example> - </para><para> + </programlisting> + </example> + </para> + <para> See also <function>date</function> and <function>time</function>. </para> </refsect1> @@ -426,11 +437,13 @@ <void> </funcsynopsis> <para> - Returns the string "msec sec" where sec is the current time measured in the - number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and - msec is the microseconds part. This function is only available on operating - systems that support the gettimeofday() system call. - </para><para> + Returns the string "msec sec" where sec is the current time + measured in the number of seconds since the Unix Epoch (0:00:00 + January 1, 1970 GMT), and msec is the microseconds part. This + function is only available on operating systems that support the + gettimeofday() system call. + </para> + <para> See also <function>time</function>. </para> </refsect1>

« previous php.dev (#8566) next »