current_time


current_time ( $type, $gmt = 0 )

Parameters:
  • (string) $type Type of time to retrieve. Accepts 'mysql', 'timestamp', or PHP date format string (e.g. 'Y-m-d').
  • (int|bool) $gmt Optional. Whether to use GMT timezone. Default false.
Returns:
  • (int|string) Integer if $type is 'timestamp', string otherwise.
Defined at:

Description

Retrieve the current time based on specified type.

The 'mysql' type will return the time in the format for MySQL DATETIME field. The 'timestamp' type will return the current timestamp. Other strings will be interpreted as PHP date formats (e.g. 'Y-m-d').

If $gmt is set to either '1' or 'true', then both types will use GMT time. if $gmt is false, the output is adjusted with the GMT offset in the WordPress option.

Related Functions

current_filter, current_action, get_current_theme, comment_time, current_theme_info

Top Google Results

User discussions

wpseek mobile