Changeset 740 for trunk/lib/App.inc.php
- Timestamp:
- Nov 30, 2020 2:27:06 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r739 r740 1879 1879 } 1880 1880 1881 // Create a DateTime object and conver the timezone from server to user. 1882 $dt = $this->convertTZ($datetime, $this->getParam('php_timezone'), $this->getParam('user_timezone')); 1881 try { 1882 // Create a DateTime object and conver the timezone from server to user. 1883 $dt = $this->convertTZ($datetime, $this->getParam('php_timezone'), $this->getParam('user_timezone')); 1884 } catch (Exception $e) { 1885 $this->logMsg(sprintf('DateTime failed to parse string in %s: %s', __METHOD__, $datetime), LOG_NOTICE, __FILE__, __LINE__); 1886 return ''; 1887 } 1883 1888 1884 1889 // By default, we try to use a localized date format. Set lc_date_format to null to use regular date_format instead. … … 1906 1911 function dateToServerTZ($datetime, $format='Y-m-d H:i:s') 1907 1912 { 1908 return $this->convertTZ($datetime, $this->getParam('user_timezone'), $this->getParam('php_timezone'))->format($format); 1913 try { 1914 // Create a DateTime object and conver the timezone from server to user. 1915 $dt = $this->convertTZ($datetime, $this->getParam('user_timezone'), $this->getParam('php_timezone')); 1916 } catch (Exception $e) { 1917 $this->logMsg(sprintf('DateTime failed to parse string in %s: %s', __METHOD__, $datetime), LOG_NOTICE, __FILE__, __LINE__); 1918 return ''; 1919 } 1920 1921 return $dt->format($format); 1909 1922 } 1910 1923
Note: See TracChangeset
for help on using the changeset viewer.