Skip to content

Commit 2aee1d0

Browse files
authored
Fixed handling of timezoneindepent datetime and date only columns
1 parent c22cea7 commit 2aee1d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Entity.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,9 @@ private function setAttributesFromDOM( Client $auth, DOMElement $attributesNode,
919919
/* Date/Time - Parse this into a PHP Date/Time */
920920
//$storedValue = date("m/d/y", self::parseTime($attributeValue, '%Y-%m-%dT%H:%M:%SZ'));
921921
$dateTimeFormat = '%Y-%m-%dT%H:%M:%SZ';
922-
if ( $this->attributes[ $attributeKey ]->format === 'DateOnly' ) {
923-
$dateTimeFormat = '%Y-%m-%dT%H:%M:%S'; // DateOnly is time- and timezone-agnostic
922+
if ( $this->attributes[ $attributeKey ]->dateTimeBehavior === 'DateOnly' ||
923+
$this->attributes[ $attributeKey ]->dateTimeBehavior === 'TimeZoneIndependent' ) {
924+
$dateTimeFormat = '%Y-%m-%dT%H:%M:%S'; // dateonly and tzi do not have timezone information
924925
}
925926
$storedValue = self::parseTime( $attributeValue, $dateTimeFormat );
926927
break;

0 commit comments

Comments
 (0)