Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




iso8601_timezone_to_offset [ WordPress Function ]

iso8601_timezone_to_offset ( $timezone )
Parameters:
  • (string) $timezone Either 'Z' for 0 offset or '±hhmm'.
Returns:
  • (int|float) The offset in seconds.
Defined at:



Computes an offset in seconds from an iso8601 timezone.

Source


<?php
function iso8601_timezone_to_offset($timezone) {
    
// $timezone is either 'Z' or '[+|-]hhmm'
    
if ($timezone == 'Z') {
        
$offset 0;
    } else {
        
$sign    = (substr($timezone01) == '+') ? : -1;
        
$hours   intval(substr($timezone12));
        
$minutes intval(substr($timezone34)) / 60;
        
$offset  $sign 3600 * ($hours $minutes);
    }
    return 
$offset;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics