Changeset 9616 for trunk/wp-includes/functions.php
- Timestamp:
- 11/11/2008 07:56:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r9444 r9616 113 113 * @return string The date, translated if locale specifies it. 114 114 */ 115 function date_i18n( $dateformatstring, $unixtimestamp ) {115 function date_i18n( $dateformatstring, $unixtimestamp, $gmt = false ) { 116 116 global $wp_locale; 117 117 $i = $unixtimestamp; 118 118 // Sanity check for PHP 5.1.0- 119 if ( -1 == $i)120 $i = false;119 if ( intval($i) < 1 ) 120 $i = time(); 121 121 122 122 if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) { … … 137 137 $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 ); 138 138 } 139 $j = @date( $dateformatstring, $i );139 $j = $gmt? @gmdate( $dateformatstring, $i ) : @date( $dateformatstring, $i ); 140 140 return $j; 141 141 }
Note: See TracChangeset
for help on using the changeset viewer.