This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Dates before 1900
Started 15 years ago by aolmos | 10 posts |
-
Good evening,
We have a problem with the date field. When the visitors fill, for example 12/12/1880, it converts the date to 13/12/1901 or 1961.
How could we have these dates correctly stored?
Angel
Posted 15 years ago # -
Any idea?
Posted 15 years ago # -
Hi,
Where did you get the date converted, your mysql data or machform entry page ?
Since PHP have limitation on date function, with valid range is typically from 13 Dec 1901 GMT to 19 Jan 2038. There might be some glitch when see the date format under 1901.Anyway to fix the date in view entry, you need to edit "entry-functions.php" file. Go around line 351 and you will see this code :
$date_value = date("m/d/Y",strtotime($date_value));
try replace the code with this
$temp_date = explode('-',$date_value); $date_value = $temp_date[1] .'/' . $temp_date[2] .'/' . $temp_date[0] ;
then go to line 360, you will see this code
$date_value = date("d/m/Y",strtotime($date_value));
replace with this
$temp_date = explode('-',$date_value); $date_value = $temp_date[2] .'/' . $temp_date[1] .'/' . $temp_date[0] ;
MachForm Support
Posted 15 years ago # -
Thank you! It worked ok
Posted 15 years ago # -
Hi!
I've been testing these modifications, but something weird happens. Some dates are received correct, but some others are still changed.
Angel
Posted 15 years ago # -
What dates are received incorrectly? Can you post some examples?
MachForm Founder
Posted 15 years ago # -
Solicitud de Certificado de Nacimiento [#13555 Jesús Gimen ez Lopez]
[...]
Fecha del nacimiento 13/12/1901
This date is not correct. The customer typed a date in 1894
Angel
Posted 15 years ago # -
Seleccione provincia de nacimiento Sta Cruz de Tenerife
Tipo de certificación Literal
Finalidad del certificado NACIONALIDAD
Nombre y apellidos ***************
Tomo TOMO **
Folio PAGINA **
Fecha del nacimiento 31/12/1969Posted 15 years ago # -
Solved, it was an Excel problem
Posted 14 years ago # -
Now I have version 4, and found the same problem. What can I do?
Posted 10 years ago #
Reply
You must log in to post.