| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public static function get_default() { |
||
| 31 | $timezone_string = get_option( 'timezone_string' ); |
||
| 32 | |||
| 33 | if ( ! empty( $timezone_string ) ) { |
||
| 34 | return new DateTimeZone( $timezone_string ); |
||
| 35 | } |
||
| 36 | |||
| 37 | $offset = get_option( 'gmt_offset' ); |
||
| 38 | $hours = (int) $offset; |
||
| 39 | $minutes = abs( ( $offset - (int) $offset ) * 60 ); |
||
| 40 | $offset = sprintf( '%+03d:%02d', $hours, $minutes ); |
||
| 41 | |||
| 42 | return new DateTimeZone( $offset ); |
||
| 43 | } |
||
| 45 |