mycred_date_to_gmt_timestamp

Description

This function will convert a well formatted date to a GMT unix timestamp. Uses strtotime.

Available since version 1.7

Returns

(int | bool) Returns a UNIX timestamp or FALSE if the date provided if incorrectly formatted.

Parameters

Param Type Required Description
function mycred_date_to_gmt_timestamp(
$date string Yes

A well formatted date that strtotime understands.

) { ... }

Examples

Example 1: Convert a given date into a GMT unix timestamp

$date = '2016-12-01';

$timestamp = mycred_date_to_gmt_timestamp( $date );