Changeset 11008 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 08/10/2016 12:55:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r10972 r11008 1259 1259 } 1260 1260 1261 /** 1262 * Output an ISO-8601 date from a date string. 1263 * 1264 * @since 2.7.0 1265 * 1266 * @param string String of date to convert. Timezone should be UTC before using this. 1267 * @return string 1268 */ 1269 function bp_core_iso8601_date( $timestamp = '' ) { 1270 echo bp_core_get_iso8601_date( $timestamp ); 1271 } 1272 /** 1273 * Return an ISO-8601 date from a date string. 1274 * 1275 * @since 2.7.0 1276 * 1277 * @param string String of date to convert. Timezone should be UTC before using this. 1278 * @return string 1279 */ 1280 function bp_core_get_iso8601_date( $timestamp = '' ) { 1281 if ( ! $timestamp ) { 1282 return ''; 1283 } 1284 1285 $date = new DateTime( $timestamp, new DateTimeZone( 'UTC' ) ); 1286 return $date->format( DateTime::ISO8601 ); 1287 } 1288 1261 1289 /** Messages ******************************************************************/ 1262 1290
Note: See TracChangeset
for help on using the changeset viewer.