Tribe__Date_Utils::date_only( int|string $date, bool $isTimestamp = false, string|null $format = null )
Returns the date only.
Contents
Parameters
- $date
-
(int|string) (Required) The date (timestamp or string).
- $isTimestamp
-
(bool) (Optional) Is $date in timestamp format?
Default value: false
- $format
-
(string|null) (Optional) The format used
Default value: null
Return
(string) The date only in DB format.
Source
File: src/Tribe/Date_Utils.php
public static function date_only( $date, $isTimestamp = false, $format = null ) {
$date = $isTimestamp ? $date : strtotime( $date );
if ( is_null( $format ) ) {
$format = self::DBDATEFORMAT;
}
return date( $format, $date );
}