Description
Returns a date in the GMT equivalent.
Requires and returns a date in the Y-m-d H:i:s format. Simply subtracts the value of the 'gmt_offset' option.
Usage
<?php get_gmt_from_date( $string, $format = 'Y-m-d H:i:s') ?>
Parameters
- $string
- (string) (required) The date to be converted.
- Default: None
- $format
- (string) (optional) The format string for the returned date.
- Default: 'Y-m-d H:i:s'
Return Values
- (string)
- GMT version of the date provided.
Examples
Notes
- Uses: get_option() to retrieve the value of the 'gmt_offset' option.
Change Log
Since: 1.2.0
Source File
get_gmt_from_date() is located in wp-includes/formatting.php
.
Related