From 0129c357e74dee080f796fd9916d10d25ce14ec8 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Fri, 23 May 2014 10:39:37 -0500
Subject: [PATCH] forms: Use standardize date formats from UI

---
 include/class.forms.php | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/class.forms.php b/include/class.forms.php
index 7b5fab20a..1f27486ed 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -1139,9 +1139,8 @@ class DatetimePickerWidget extends Widget {
 
         $config = $this->field->getConfiguration();
         if ($this->value) {
-            $this->value = (is_int($this->value) ? $this->value :
-                DateTime::createFromFormat($cfg->getDateFormat(), $this->value)
-                ->format('U'));
+            $this->value = is_int($this->value) ? $this->value :
+                strtotime($this->value);
             if ($config['gmt'])
                 $this->value += 3600 *
                     $_SESSION['TZ_OFFSET']+($_SESSION['TZ_DST']?date('I',$this->value):0);
-- 
GitLab