Comments (2)
Hello, interesting case. You are right that this is a timezone issue.
You are setting DTSTART with an explicit time in UTC (Z
) timezone, but check_date
with no time, so it picks up the time configured in your PHP instance, which I'm going to guess isn't UTC.
So if you set the time also to UTC, this should work:
'check_date' => '2023-05-01 00:00:00Z'
Alternatively, if you remove the time from DTSTART, this should also work:
$task = [
'rrule' => 'DTSTART:20220803
RRULE:FREQ=MONTHLY;INTERVAL=3;BYDAY=1MO',
'check_date' => '2023-05-01'
];
A 3rd option, if you set PHP timezone to UTC, this should also work:
date_default_timezone_set('UTC');
$task = [
'rrule' => 'DTSTART:20220803T000000Z
RRULE:FREQ=MONTHLY;INTERVAL=3;BYDAY=1MO',
'check_date' => '2023-05-01'
];
I'll admit it's a bit confusing, but essentially you have to make sure the time component of DTSTART matches exactly with the time component of the occurrence you want to check - or don't use time component at all.
from php-rrule.
Hey, thanks so much for the quick reply, it makes perfect sense that's why it's failing. Simply appending the Z
to the time worked.
from php-rrule.
Related Issues (20)
- Humanreadable gets monthly wrong HOT 4
- addExRule not working for me HOT 4
- Drop support for PHP < 7.3 HOT 2
- Daylight Savings Time issue with PHP 8.1 HOT 13
- How to create Rrule for every day from X to Y? HOT 4
- How to use exdate with byhour? HOT 3
- Question: Performance optimization when calculating occurrences using multiple rules HOT 3
- exRule and addRule conflict HOT 3
- More forgiving DTSTART behavior when using only date for UNTIL HOT 2
- Nested exrules HOT 2
- Problem with getOccurrencesAfter HOT 9
- Removing all dates that are inside a DatePeriod from Rset HOT 1
- bi-weekly occurance wrong HOT 3
- dtstart vs. Repeat Dates / Current Time Not Considered in Calculation HOT 5
- humanreadable not so much HOT 2
- Looking for a way to add DTEND HOT 1
- Exrul not working
- Add alias methods for better reading of code HOT 1
- Legacy Code - Can I 'require_once' instead of composer ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-rrule.