Skip to content

DateTime::createFromTimestamp overflowed microseconds value #14383

Closed
@ranvis

Description

@ranvis

Description

The following code:

<?php
echo DateTime::createFromTimestamp(0.999_999_9)->format('s.u'), "\n";

Resulted in this output:

00.1000000

But I expected this output instead:

01.000000 or 00.999999

Though some don't agree, I prefer to 00.999999 than 01.000000 for date and time.
23:59:59.999_999_9 is not technically tomorrow.

PHP Version

dev-master 5e242fe

Operating System

irrelevant

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions