Make WordPress Core

Changeset 913


Ignore:
Timestamp:
02/23/2004 03:04:55 AM (22 years ago)
Author:
michelvaldrighi
Message:

added get_gmt_from_date()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-formatting.php

    r907 r913  
    378378
    379379// used by wp-mail to handle charsets in email subjects
    380 
    381380function wp_iso_descrambler($string) {
    382381  /* this may only work with iso-8859-1, I'm afraid */
     
    390389}
    391390
     391
     392// give it a date, it will give you the same date as GMT
     393function get_gmt_from_date($string) {
     394  global $time_difference;
     395  // $string must be of the form 'yyyy-mm-dd hh:mm:ss'
     396  if ($string != gmdate('Y-m-d H:i:s')) {
     397    $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));
     398    $gmt_time = $string_time - $time_difference*3600;
     399    return gmdate('Y-m-d H:i:s', $gmt_time);
     400  } else {
     401    return $string;
     402  }
     403}
     404
    392405?>
Note: See TracChangeset for help on using the changeset viewer.