| 1 common.test | private CommonFormatDateTestCase::createTimestamp($dateTimeString) |
Creates a UNIX timestamp given a date and time string in the format year-month-day hour:minute:seconds (e.g. 2013-12-11 10:09:08).
Parameters
string $dateTimeString: The formatted date and time string.
Return value
int: The UNIX timestamp.
File
- core/
modules/ simpletest/ tests/ common.test, line 3435 - Tests for common.inc functionality.
Class
- CommonFormatDateTestCase
- Tests the format_date() function.
Code
private function createTimestamp($dateTimeString) {
return \DateTime::createFromFormat('Y-m-d G:i:s', $dateTimeString)->getTimestamp();
}