Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezdateutils.php
Go to the documentation of this file.
1 <?php
17 class eZDateUtils
18 {
34 static function rfc1123Date( $timestamp = false )
35 {
36 if ( $timestamp === false )
37 $timestamp = time();
38 $wday = (int) gmdate( 'w', $timestamp );
39 $days = array( 1 => 'Mon', 2 => 'Tue', 3 => 'Wed',
40 4 => 'Thu', 5 => 'Fri', 6 => 'Sat', 0 => 'Sun' );
41 $wkday = $days[$wday];
42 $month = (int) gmdate( 'n', $timestamp );
43 $months = array( 1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr',
44 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug',
45 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec' );
46
47 $mon = $months[$month];
48 return $wkday . gmdate( ", d ", $timestamp ) . $mon . gmdate( " Y H:i:s", $timestamp ) . " GMT" ;
49 }
50
68 static function rfc850Date( $timestamp = false )
69 {
70 if ( $timestamp === false )
71 $timestamp = time();
72 $wday = (int) gmdate( 'w', $timestamp );
73 $days = array( 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday',
74 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 0 => 'Sunday' );
75 $weekday = $days[$wday];
76 $month = (int) gmdate( 'n', $timestamp );
77 $months = array( 1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr',
78 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug',
79 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec' );
80 $mon = $months[$month];
81 return $weekday . gmdate( ", d-", $timestamp ) . $mon . gmdate("-Y H:i:s", $timestamp) . " GMT" ;
82 }
83
88 static function textToDate( $dateText )
89 {
90 return strtotime( $dateText );
91 }
92 }
93
94 ?>
eZDateUtils
The class eZDateUtils does.
Definition: ezdateutils.php:18
eZDateUtils\rfc850Date
static rfc850Date( $timestamp=false)
Definition: ezdateutils.php:68
eZDateUtils\textToDate
static textToDate( $dateText)
Definition: ezdateutils.php:88
eZDateUtils\rfc1123Date
static rfc1123Date( $timestamp=false)
Definition: ezdateutils.php:34
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.