File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ class eZTimestamp
1414 \return a timestamp in UTC
1515 */
1616 public static function getUtcTimestampFromLocalTimestamp ( $ localTimestamp ) {
17+
18+ if ( !$ localTimestamp )
19+ {
20+ return null ;
21+ }
22+
1723 $ utcTimezone = new \DateTimeZone ( 'UTC ' );
1824 $ localTimezone = new \DateTimeZone ( date_default_timezone_get () );
1925
@@ -28,6 +34,12 @@ public static function getUtcTimestampFromLocalTimestamp( $localTimestamp ) {
2834 \return a timestamp in timezone defined in php.ini
2935 */
3036 public static function getLocalTimestampFromUtcTimestamp ( $ utcTimestamp ) {
37+
38+ if ( !$ utcTimestamp )
39+ {
40+ return null ;
41+ }
42+
3143 $ utcTimezone = new \DateTimeZone ( 'UTC ' );
3244 $ localTimezone = new \DateTimeZone ( date_default_timezone_get () );
3345
You can’t perform that action at this time.
0 commit comments