mirror of
git://develop.git.wordpress.org/
synced 2025-01-31 20:38:54 +01:00
added get_date_from_gmt()
git-svn-id: https://develop.svn.wordpress.org/trunk@917 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4923a4f2c5
commit
e6a37dfd73
@ -402,4 +402,17 @@ function get_gmt_from_date($string) {
|
||||
}
|
||||
}
|
||||
|
||||
// give it a GMT date, it will give you the same date with $time_difference added
|
||||
function get_date_from_gmt($string) {
|
||||
$time_difference = get_settings('time_difference');
|
||||
// $string must be of the form 'yyyy-mm-dd hh:mm:ss'
|
||||
if ($string == gmdate('Y-m-d H:i:s')) {
|
||||
$string_time = gmmktime(substr($string,11,13), substr($string,14,16), substr($string,17,19), substr($string,5,7), substr($string,8,10), substr($string,0,4));
|
||||
$local_time = $string_time + $time_difference*3600;
|
||||
return gmdate('Y-m-d H:i:s', $local_time);
|
||||
} else {
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user