Core Function
View Source on Trac ↗ current_time()
current_time( mixed $type, mixed $gmt = 0 ) Retrieves the current time based on specified type.
Parameters 2 required
| Name / Type | Description |
|---|---|
| string | $type Type of time to retrieve. Accepts 'mysql', 'timestamp', 'U', or PHP date format string (e.g. 'Y-m-d'). Required |
| (int | | bool) $gmt Optional. Whether to use GMT timezone. Default false. Required |
Return Value
((int)
| string) Integer if `$type` is 'timestamp' or 'U', string otherwise.
Function Information
Since Version
1.0.0
Source File
wp-includes/functions.php
Advertisement