get_date_from_gmt [ WordPress Function ]
get_date_from_gmt ( $string, $format = 'Y-m-d H:i:s' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_gmt_from_date, get_id_from_blogname, get_images_from_uri, get_page_of_comment, get_the_term_list
Converts a GMT date into the correct format for the blog.
Requires and returns in the Y-m-d H:i:s format. Simply adds the value of gmt_offset.Return format can be overridden using the $format parameter
Source
<?php
function get_date_from_gmt($string, $format = 'Y-m-d H:i:s') {
preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches);
$string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
$string_localtime = gmdate($format, $string_time + get_option('gmt_offset')*3600);
return $string_localtime;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get date from gmt « WordPress Codex
Description. Converts a GMT date into the correct format for the blog. Requires and returns in the Y-m-d H:i:s format. Simply adds the value of the 'gmt_offset' ...
codex.wordpress.org - #13173 (get_date_from_gmt does not properly convert non-DST ...
If it is May 1 where I am and daylight-savings time is in effect, and I schedule a post for December 1 at noon (when DST is not in effect) via XML-RPC using the ...
core.trac.wordpress.org - get_date_from_gmt() WordPress function reference, arguments and ...
Converts a GMT date into the correct format for the blog.
queryposts.com - get_date_from_gmt | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_date_from_gmt($string, $format = 'Y-m-d H:i:s') { preg_match('#([0-9] {1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1 ...
hitchhackerguide.com