-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
An RRule created with a timestamp start date generates an invalid RFC string #15
Comments
Yep that's a bug alright, thanks for the report. On a related note: when you create the rule with a timestamp, do you expect the results (and the RFC string generated) to be in your timezone (America/Chicago in your example)? At the moment they are in UTC since a timestamp is UTC (by definition) but I'm curious to know what you think. |
Yeah, I think that keeping the results in UTC is probably the correct way to do it. Otherwise, users might get unexpected results (because of a default timezone setting somewhere) that will be hard to track down where they are coming from. |
PHP's default is to put them in "+00:00" timezone, which generates invalid RFC string. The method rfcString() will convert all invalid timezones to UTC to generate a valid RFC string.
Thanks. I pushed a fix on dev-master, could you try and let me know if it solves your problem? |
Yep, seems to be working now! |
Thanks! |
generates the following output:
The RFC string is: DTSTART;TZID=+00:00:20160804T150611 RRULE:FREQ=WEEKLY
Parsing RFC string: Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Invalid DTSTART property: date or date time format incorrect' in /path/to/php-rrule/RRule.php:649
This is because the RFC string generated has the timezone set as "+00:00" rather than "UTC".
The text was updated successfully, but these errors were encountered: