Ideally if you could link to the page you are having problems with, that would be great.
Given the point at which you are having problems, it sounds like a unix time stamp issue, so something somewhere is converting to / from a unix time stamp, and not being able to use negative numbers.
Thanks for pointing that out. The issue there is that in the database that field (start_date) is a timestamp field about which the MySQL manual says:
The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.
A more appropriate field type would be DATE or DATETIME which have much wider allowed values.
I'll update my demo database with the next release.
I have the database field type as Date, and still receive teh same error.
I also manually edited teh date in teh database to 1969-01-01 and load the page and it gives me the correct date. However, on edit to another pre 1970 date, I receive this Error - Date is not in the expected format
This might be an issue with the script? Please help
Is it the registered_date field that you are having a problem with specifically?
It would appear that PHP's date() method does not like using the two digit year format for <1970. If you use the four digit format (Y rather than y in PHP and yy for jQuery UI) that should work as expected.
Replies
Please supply details of your "major issue".
Ideally if you could link to the page you are having problems with, that would be great.
Given the point at which you are having problems, it sounds like a unix time stamp issue, so something somewhere is converting to / from a unix time stamp, and not being able to use negative numbers.
Regards,
Allan
Consider editing the Registered Date here -> and changing the date to any pre 1970 date.
https://editor.datatables.net/examples/simple/dates.html
I receive this Error - Date is not in the expected format
Any work around suggestions appreciated.
Hi,
Thanks for pointing that out. The issue there is that in the database that field (
start_date
) is atimestamp
field about which the MySQL manual says:A more appropriate field type would be
DATE
orDATETIME
which have much wider allowed values.I'll update my demo database with the next release.
Regards,
Allan
I have the database field type as Date, and still receive teh same error.
I also manually edited teh date in teh database to 1969-01-01 and load the page and it gives me the correct date. However, on edit to another pre 1970 date, I receive this Error - Date is not in the expected format
This might be an issue with the script? Please help
If I update my database using:
Then I'm able to successfully edit the date column to be <1970.
Do you have a validator? If so, what is that validator?
Allan
This example is at the link
https://editor.datatables.net/examples/simple/dates.html
The dates are Update date and Registered date with date picker.
database Field Type is datetime
Is it the
registered_date
field that you are having a problem with specifically?It would appear that PHP's
date()
method does not like using the two digit year format for <1970. If you use the four digit format (Y
rather thany
in PHP andyy
for jQuery UI) that should work as expected.Allan
Perfect that works for JQuery UI - thanks