fightbulc / moment.php

Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js
Other
973 stars 154 forks source link

getRelative() returns "0 years ago" #179

Closed iluuu1994 closed 4 years ago

iluuu1994 commented 5 years ago

We've received this report from a user:

image

The following snippet reproduces the problem:

$date = new \DateTime('-5341 second');
$date = new Moment($date->getTimestamp());
echo $date->fromNow()->getRelative();

0 years ago

I found this number via script. There are possibly other values that yield the same result.