MyBB Community Forums

Full Version: Prostats Dates Are Zeros?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Folks

Putting this in General rather than Plugins as I'm not convinced this is a problem caused by the Prostats Plugin but more likely myBB?

Running myBB 1.8.10 and Prostats 1.9.7

Some of the dates on the Prostats "Latest Posts" are showing as zeros - see image below

Any ideas folks?

Cheers
Bugs

[Image: zeros2.jpg]

Update:

Removing H:i from the entry under Date and Time Format in Prostats settings seems to have fixed this issue.

Cheers
Bugs
ProStats seems to rely on PHP's date() function, rather than using the DateTime class.
If the plugin switches to that class, the problem is easily fixed.

For example, see PHP's date() function documentation: http://php.net/manual/en/function.date.php:
Quote:Note that date() will always generate 000000 since it takes an integer parameter, whereas DateTime::format() does support microseconds if DateTime was created with microseconds.
This is a note which you can find under the variables for time. Smile

EDIT:
Removing H:i under the plugin's date and time setting didn't solve the issue for me. Running the site on nginx and PHP 7.0.26-1.
Quote:EDIT:
Removing H:i under the plugin's date and time setting didn't solve the issue for me. Running the site on nginx and PHP 7.0.26-1.

Agreed, have the same setup as you and when I removed the H:i it didn't solve the issue either for me. What I don't get is that it's not doing this for all the dates, only certain ones.

[Image: 2lnic9g.jpg]
Did anyone ever solve this? I see it's marked as solved so care to share?

Edit: I fixed it by changing the date and time format in ProStats settings to 'M-d, h:i' without quotes. It seems when you change the Date and Time variable part in order for the date to be replaced with "Yesterday" or "Today" on some posts, they all change to zero. No matter what value. I wonder why that is.
(2018-07-21, 07:57 AM)leetforums Wrote: [ -> ]Did anyone ever solve this? I see it's marked as solved so care to share?

Edit: I fixed it by changing the date and time format in ProStats settings to 'M-d, h:i' without quotes. It seems when you change the Date and Time variable part in order for the date to be replaced with "Yesterday" or "Today" on some posts, they all change to zero. No matter what value. I wonder why that is.


It works. Thanks for sharing!