WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get date from gmt

Contents

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' option.

Usage

<?php get_date_from_gmt$string$format ?>

Parameters

$string
(string) (required) The date to be converted.
Default: None
$format
(string) (false) The format string for the returned date
Default: Y-m-d H:i:s

Return Values

(string) 
Formatted date relative to the GMT offset.

Examples

Notes

Change Log

Since: 1.2.0

Source File

get_date_from_gmt() is located in wp-includes/formatting.php.

Related

See also index of Function Reference and index of Template Tags.