Skip to content
This repository was archived by the owner on Mar 26, 2021. It is now read-only.
This repository was archived by the owner on Mar 26, 2021. It is now read-only.

When site has no GMT offset saved, the expiry datetime causes problems #52

@benlk

Description

@benlk

When the 'gmt_offset' value is a number (which is pretty much everywhen), the DateTimeZone constructor complains that the number is not a valid timezone.

return date_add( date_create( $future, new DateTimeZone( $timezone ) ), new DateInterval( 'P7D' ) );
} else {
// return DateTime for the expiry date
return date_create( $iso_8601, new DateTimeZone( $timezone ) );

PHP Fatal Error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (-4)' in /plugins/npr-story-api/psuh_story.php:676'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions