You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d63a82c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,8 @@ class Product extends Freshsauce\Model\Model
178
178
179
179
Supported cast types are `integer`, `float`, `boolean`, `datetime`, `array`, and `object`.
180
180
181
+
`datetime` casts assume stored strings are UTC wall-time values. If you do not want implicit timezone conversion by the database, prefer `DATETIME`-style columns or ensure the connection session timezone is UTC before using `TIMESTAMP` columns.
182
+
181
183
### Dynamic finders and counters
182
184
183
185
Build expressive queries straight from method names:
Copy file name to clipboardExpand all lines: docs/api-reference.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,8 @@ Optional. Defaults to `updated_at`. Set to a different column name to customise
42
42
43
43
Optional. Field cast map. Supported cast types are `integer`, `float`, `boolean`, `datetime`, `array`, and `object`.
44
44
45
+
For `datetime`, string values are interpreted as UTC wall-time values. Prefer `DATETIME`-style columns, or ensure the connection session timezone is UTC when using database types that perform timezone conversion.
46
+
45
47
### `public static $_db`
46
48
47
49
Inherited shared PDO connection. Redeclare this in a subclass only when that subclass needs an isolated connection.
Copy file name to clipboardExpand all lines: docs/guide.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -578,6 +578,7 @@ Notes:
578
578
-`datetime` returns `DateTimeImmutable`
579
579
-`array` and `object` are stored as JSON strings in the database
580
580
-`toArray()` returns the current cast PHP values
581
+
-`datetime` assumes stored strings are UTC wall-time values; prefer `DATETIME`-style columns or a UTC session timezone when using databases that convert `TIMESTAMP`
0 commit comments