2020-04-22 22:48:56 +03:00
|
|
|
|
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
2015-10-18 20:48:39 +03:00
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
2024-01-01 01:14:38 +03:00
|
|
|
|
* MaketRandevu - MAKET Randevu Portalı
|
2015-10-18 20:48:39 +03:00
|
|
|
|
*
|
|
|
|
|
* @package EasyAppointments
|
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2021-12-18 19:43:45 +03:00
|
|
|
|
* @copyright Copyright (c) Alex Tselegidis
|
|
|
|
|
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
|
|
|
* @link https://easyappointments.org
|
2015-10-18 20:48:39 +03:00
|
|
|
|
* @since v1.0.0
|
|
|
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
/**
|
2021-10-24 23:00:16 +03:00
|
|
|
|
* Validate a date time value.
|
2015-10-18 20:48:39 +03:00
|
|
|
|
*
|
2021-10-24 23:00:16 +03:00
|
|
|
|
* @param string $value Validation value.
|
2020-12-05 12:55:20 +03:00
|
|
|
|
*
|
2015-10-18 20:48:39 +03:00
|
|
|
|
* @return bool Returns the validation result.
|
|
|
|
|
*/
|
2021-10-24 23:00:16 +03:00
|
|
|
|
function validate_datetime(string $value): bool
|
2017-09-15 14:36:37 +03:00
|
|
|
|
{
|
2021-10-24 23:00:16 +03:00
|
|
|
|
$date_time = DateTime::createFromFormat('Y-m-d H:i:s', $value);
|
2020-12-05 12:55:20 +03:00
|
|
|
|
|
2023-11-29 12:24:09 +03:00
|
|
|
|
return (bool) $date_time;
|
2015-10-18 20:48:39 +03:00
|
|
|
|
}
|