Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

validateDatetime()

Description

Utility function to check string is a valid date/time

Parameters

ColumnTypeDefaultDescription
$datestring string - date string
$format string 'Y-m-d H:i:s' - DateTime format to compare

Return

boolean

Location

include/migration_functions.php lines 289 to 293

Definition

 
function validateDatetime($datestring$format 'Y-m-d H:i:s')
    {
    
$date DateTime::createFromFormat($format$datestring);
    return 
$date && $date->format($format) == $datestring;
    }

This article was last updated 29th November 2020 04:05 Europe/London time based on the source file dated 26th November 2020 16:30 Europe/London time.