Setting a time field with a timestamp #1878
Replies: 5 comments
-
I think I found the problem in PropelDateTime::isTimestamp
Somebody decided that an 8 digit number is not a timestamp... but it is if it is just a time value (and not a date). |
Beta Was this translation helpful? Give feedback.
-
Hmmm, I am not too familiar with the way Propel handles time values, but it looks like you have to use a format that php DateTime understands (https://www.php.net/manual/en/datetime.formats.time.php). |
Beta Was this translation helpful? Give feedback.
-
I checked, Propel accepts a string, a DateTime object or a timestamp. However, specifying an 8 digit number is not a valid timestamp makes these timestamps invalid: Can we have that test removed please? |
Beta Was this translation helpful? Give feedback.
-
the thing with the 8 digit number seems strange, but apparently, it is there to allow for date input in format Ymd, as in '20220505'. Tests fail when removing it:
But I have to agree, disabling a number of valid timestamps is a pretty harsh side effect. Not sure what a good solution would be. |
Beta Was this translation helpful? Give feedback.
-
Well, since those are as string, I would assume that as int we can allow normal date integers
Maybe we can even deprecate that part and require it to be a consistent documented format. |
Beta Was this translation helpful? Give feedback.
-
Hello again
I'm struggling with an odd problem.
My table 'Period' has a field 'Hmend' which is of type 'time' is giving me an error when I try to store a timestamp in this field.
(PS This has been working for many years in Propel1.6)
Here is the error:
From calendar.ajax.php near line 1460:
My definition of the Hmend field in the schema file:
And in the database:
This is happening every time.
I'm still investigating what is causing this.
Beta Was this translation helpful? Give feedback.
All reactions