Jump to content


Display of early dates

dates display

  • Please log in to reply
3 replies to this topic

#1 Koia

Koia

    Member

  • Members
  • PipPip
  • 10 posts

Posted 09 November 2013 - 11: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?



#2 Koia

Koia

    Member

  • Members
  • PipPip
  • 10 posts

Posted 12 November 2013 - 10: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?



#3 briggers

briggers

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationBracknell, UK

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



#4 Koia

Koia

    Member

  • Members
  • PipPip
  • 10 posts

Posted 14 November 2013 - 10: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.







Also tagged with one or more of these keywords: dates, display

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users