Comments (5)
What version of Chronos are you using?
Do you set a locale?
from chronos.
I use version 1.2.3
.
I don't set a locale.
from chronos.
I'm not able to reproduce the results you're having in a test application I have locally.
ᐉ bin/cake console
You can exit with `CTRL-C` or `exit`
Psy Shell v0.10.6 (PHP 7.4.9 — cli) by Justin Hileman
>>> \Cake\Core\Configure::version()
=> "4.2.4"
>>> $d = new Cake\Chronos\Chronos('1968-01-01');
=> Cake\Chronos\Chronos @-63158400 {#2609
hasFixedNow: false,
time: "1968-01-01 00:00:00.000000",
date: 1968-01-01 00:00:00.0 UTC (+00:00),
}
>>> $d->year;
=> 1968
from chronos.
Is your snippet complete, is there some additional step? There is double closing parenthesis.
new Chronos('1969-01-01'))->year // 2069
^
Behavior to add 100 years to year before 70 exists when parsing two digits year like '69-01-01'.
from chronos.
I'm sorry. It will be here correctly
$year = (new Chronos('1969-01-01'))->year // 2069
Behavior to add 100 years to year before 70 exists when parsing two digits year like '69-01-01'.
Okay, I understand. I'll execute by four digits.
from chronos.
Related Issues (20)
- Drop PHP 7.2? HOT 9
- Drop src/carbon_compat.php HOT 4
- Trim down the ChronosInterface's API HOT 8
- Chronos3: BC handling with native type/interface HOT 1
- ComparisonTrait::isSameDay() / ComparisonTrait::isSameMonth() HOT 2
- False Statement in 2.x Docs about Timezone Fixation HOT 2
- Hello, I would like to create a Java program for Windows 10 that has a button which, when clicked, starts a timer and that when it approaches minutes 10, 11, 12, and 13, opens a pop-up window with large text and an alarm sound. Can anyone help me with the code or point me in the right direction to get started? HOT 1
- Some deprecation warnings since 2.4.0 HOT 2
- Cannot construct a relative date that always points to the _next_ future date & time HOT 1
- [Question] Is there a way to have chronos properly validate the input against request format? HOT 4
- Missing Cake\Chronos\Date class HOT 3
- Reasoning around no longer extending native DateTimeImmutable HOT 14
- PHP Warning: Undefined array key "class" in /srv/www/vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php on line 166
- Method endOfDay disregarding microseconds HOT 2
- RFC - Changing default time values for Chronos::create() HOT 1
- Method toNative() has gone missing HOT 5
- 2.4.x: b/c break in Cake\Chronos\Date::create() HOT 1
- 2.4.x: addSecond() is deprecated. Use addSeconds() HOT 3
- ChronosInterval HOT 4
- 2.4.x: diffInWeekdays() is 1 for same day 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 chronos.