• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

valkyrjaio / valkyrja-php / 30728376547
100%

Build:
DEFAULT BRANCH: 26.x
Ran 02 Aug 2026 02:11AM UTC
Jobs 1
Files 1216
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Aug 2026 02:10AM UTC coverage: 100.0%. Remained the same
30728376547

push

github

web-flow
[Orm] fix(#1114)!: Store the date in a sortable ISO 8601 format (#1115)

# Description

`DateFormat` wrote a date that the database could not sort and that the
date
functions of the database could not read.

```php
public const string DEFAULT     = 'm-d-Y H:i:s T';
public const string MILLISECOND = 'm-d-Y H:i:s.v T';
public const string MICROSECOND = 'm-d-Y H:i:s.u T';
```

The ORM stamps this value into `created_at`, `updated_at` and
`deleted_at`, so
each defect below reaches every dated entity.

**The column did not sort.** The month came first, so a text sort was
not a date
sort. A probe against SQLite, which is one of the four managers that the
ORM
ships:

```
ORDER BY created_at with the old format:
  id=2  01-15-2026 10:00:00 GMT+0000
  id=3  06-10-2026 10:00:00 GMT+0000
  id=1  12-01-2025 10:00:00 GMT+0000
```

The correct order is 1, 2, 3, so a query that reads the newest row read
the
wrong row.

**The date functions gave null.** SQLite reads ISO 8601 only, so
`date()` and
`strftime()` gave null for every row, and a query could not group or
filter by a
stored date. MySQL rejects the same value for a `DATETIME` column in
strict
mode, so the format also forced the column to be text.

**The timezone suffix carried no information.** `DateFactory` builds
each time in
UTC, so `T` rendered the constant string `GMT+0000` on every row.

## The fix

```php
public const string DEFAULT     = 'Y-m-d H:i:s';
public const string MILLISECOND = 'Y-m-d H:i:s.v';
public const string MICROSECOND = 'Y-m-d H:i:s.u';
```

The same probe with the new format sorts 1, 2, 3, and each date function
reads
the value. Each format now fits a column type — `DATETIME`,
`DATETIME(3)` and
`DATETIME(6)` — so an application can hold a real date column instead of
text.
Laravel and Rails both store `Y-m-d H:i:s`, which is the convention that
valkyrjaio/valkyrja-php#1107 applied to the field names.

**The value stays UTC, and the document now says so.** Dropping `T`
removes the
only ... (continued)

12911 of 12911 relevant lines covered (100.0%)

24.46 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30728376547.1 02 Aug 2026 02:11AM UTC 1216
100.0
GitHub Action Run
Source Files on build 30728376547
  • Tree
  • List 1216
  • Changed 1
  • Source Changed 1
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30728376547
  • a3b31f40 on github
  • Prev Build on 26.x (#30727754528)
  • Next Build on 26.x (#30728835958)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc