Devise\Pages\PageVersionManager::convertToDatabaseTimestamp PHP Метод

convertToDatabaseTimestamp() защищенный Метод

Changes the timestamp from human readable to database specific
protected convertToDatabaseTimestamp ( string $timestamp, string $from = 'm/d/y H:i:s', string $to = 'Y-m-d H:i:s' ) : string
$timestamp string
$from string
$to string
Результат string
    protected function convertToDatabaseTimestamp($timestamp, $from = 'm/d/y H:i:s', $to = 'Y-m-d H:i:s')
    {
        if (!$timestamp) {
            return null;
        }
        $date = DateTime::createFromFormat($from, $timestamp);
        return $date->format($to);
    }