brick / date-time

Date and time library for PHP
MIT License
321 stars 29 forks source link

LocalDateRange::toInterval #83

Open solodkiy opened 9 months ago

solodkiy commented 9 months ago

Converting LocalDateRange to Interval is a common task in my app. Typically, I have a method to generate reports that expects a LocalDateRange argument. Subsequently, I need to transform it for SQL queries using the BETWEEN operator. It’s important to note that the timezone in my database differs from the implied timezone in LocalDateRange.

The new method introduced will transform any LocalDateRange into an Interval in the specified timezone.