tactics / datetime Goto Github PK
View Code? Open in Web Editor NEWCollection of generic DateTime concepts
License: GNU Lesser General Public License v3.0
Collection of generic DateTime concepts
License: GNU Lesser General Public License v3.0
Add a toStorage method with shortcut for popular storage formats.
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-types.html
https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-INPUT
When modifying a DateTimePlus (for example by adding days), the library is unable to consider DST because it is unaware of the timezone. The offset alone is not enough to identify the timezone and the need to adjust for DST.
As we usually work in Europe/Brussels timezone - which has DST - we always will have this problem when modifying a DateTimePlus from summertime to wintertime and vice versa.
Add a FormatWithTimezone that does what it says: include the timezone (iso the offset).
how to reproduce:
// summertime ends at 27/10/2024 when 03:00 becomes 02:00
$summerTime = DateTimePlus::from("2024-10-27T00:00:00+02:00", FormatWithTimezone::ATOM);
// add 1 day
$winterTime = $summerTime->add(0, 0, 1);
$winterFormatted = $winterTime->formatPlus("Y-MM-dd'T'HH:mm:ss.SSSZZZZZ'", 'nl_BE', new \DateTimeZone("Europe/Brussels"));
echo $winterFormatted;
// expected: 2024-10-28T00:00:00.000+01:00
// actual: 2024-10-27T23:00:00.000+01:00
Add a method to create DateTimePlus from timestamp since a timestamp is always in UTC timezone.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.