PluginProbe ʕ •ᴥ•ʔ
MainWP Child Reports / 1.8
MainWP Child Reports v1.8
0.0.1 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9.1 1.9.2 1.9.3 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.1 2.1.1 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.3 2.3.1 trunk
mainwp-child-reports / includes / functions.php
mainwp-child-reports / includes Last commit date
vendor 7 years ago admin.php 7 years ago class-wp-stream-author.php 10 years ago connector.php 7 years ago connectors.php 7 years ago context-query.php 7 years ago dashboard.php 10 years ago date-interval.php 10 years ago db.php 9 years ago filter-input.php 10 years ago functions.php 10 years ago install.php 9 years ago list-table.php 7 years ago live-update.php 9 years ago log.php 10 years ago network.php 7 years ago query.php 7 years ago settings.php 7 years ago
functions.php
31 lines
1 <?php
2
3 /**
4 * Converts a time into an ISO 8601 extended formatted string.
5 *
6 * @param int|bool $time Seconds since unix epoc
7 * @param int $offset Hour offset
8 *
9 * @return string an ISO 8601 extended formatted time
10 */
11 function mainwp_wp_stream_get_iso_8601_extended_date( $time = false, $offset = 0 ) {
12 if ( $time ) {
13 $microtime = (float) $time . '.0000';
14 } else {
15 $microtime = microtime( true );
16 }
17
18 $micro_seconds = sprintf( '%06d', ( $microtime - floor( $microtime ) ) * 1000000 );
19 $offset_string = sprintf( 'Etc/GMT%s%s', $offset < 0 ? '+' : '-', abs( $offset ) );
20
21 $timezone = new DateTimeZone( $offset_string );
22 $date = new DateTime( date( 'Y-m-d H:i:s.' . $micro_seconds, $microtime ), $timezone );
23
24 return sprintf(
25 '%s%03d%s',
26 $date->format( 'Y-m-d\TH:i:s.' ),
27 floor( $date->format( 'u' ) / 1000 ),
28 $date->format( 'O' )
29 );
30 }
31