Jump to content

Date time field not showing


erikvanberkum
 Share

Recommended Posts

Hello One year working with PW and no need to ask for help, but today have something funny going on in my date time field. 

When i input a year in the PW backend link 1867-01-01 it will be saved to the mysql database, when i reload the page, the field doesn't show up in the PW backend. 

When i try to output also no luck.

When i enter the year 1902-01-01 no problems for display in the front and backend. 

I made another date time field and got the same problem.

Anyone any ideas how to troubleshoot this issue?

I am running on version 2.7.2

Link to comment
Share on other sites

Unix timestamps do start in 1970. All times / dates before that can therefore not be translated to a timestamp and not be saved. I'm just not sure, why it's saving a date for 1902 correctly.

Edit: Ah php does work with negative integers as well. The max size for an integer (32 bit) would be -2147483648 which translates to 1901/12/13 20:45:52. So maybe it's still an issue with not being able to translate to a timestamp.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I see that PW is using the procedural date() in many places, rather than Datetime() which supports dates before 1901: http://stackoverflow.com/questions/18579567/change-the-format-of-dates-before-1900-without-using-explode

I wonder if this should be a Github issue?

EDIT: https://github.com/ryancramerdesign/ProcessWire/issues/1624

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...