⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Display of early dates



Koia

Koia
  • profile picture
  • Member

Posted 09 November 2013 - 23:38 PM

Dates before 1901-01-01 taken from my mysql tables all show up as 1970-01-01. Same problem in the datatables and flexgrid views. These dates display correctly in for instance the Ignited databables application. So I believe it is a GC problem. What to do?


Koia

Koia
  • profile picture
  • Member

Posted 12 November 2013 - 22:56 PM

Trying the early dates question again:

 

1. Is display of dates before year 1901 as 1970-01-01 related to the jQuery datepicker function for the options minDate and maxDate?

2. If so, how can I change these settings in GC?


briggers

briggers
  • profile picture
  • Member

Posted 13 November 2013 - 08:59 AM

Hi Koia

 

I suspect that the issue is caused by the way the date is stored in the database. It should be stored in a date or datetime type column in the format yyyy-mm-dd optionally with the time. If you are storing it in a varchar field then the php strtotime() function might not be able to convert the date correctly if it confuses the month and day elements of the string. So 5 March 1806 could be stored as 1806-03-05 if you are using european format or 1806-05-03 if using USA format. strtotime() would be able to interpret both of these but if you had 21 December 1806 stored as 1806-21-12 it would not be able to convert correctly and default to the 1970-01-01


Koia

Koia
  • profile picture
  • Member

Posted 14 November 2013 - 22:29 PM

Hi,

 

I tried GC 1.4.1 with same result. Early dates always appears as 1970-01-01

 

My dates are in "date" format in mysql. I also tried withe "datetime" but problem persisted.

 

I have seen examples how to configure minDate and maxDate in jQuery javascript code, but I do not know enough about GC to figure out where to place these codes to make them operate on my displayed datatables and flexgrid columns.