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


  1. aolmos
    Member

    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 14 years ago #
  2. aolmos
    Member

    Any idea?

    Posted 14 years ago #
  3. redityo

    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 14 years ago #
  4. aolmos
    Member

    Thank you! It worked ok

    Posted 14 years ago #
  5. aolmos
    Member

    Hi!

    I've been testing these modifications, but something weird happens. Some dates are received correct, but some others are still changed.

    Angel

    Posted 14 years ago #
  6. yuniar

    What dates are received incorrectly? Can you post some examples?


    MachForm Founder

    Posted 14 years ago #
  7. aolmos
    Member

    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 14 years ago #
  8. aolmos
    Member

    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/1969

    Posted 14 years ago #
  9. aolmos
    Member

    Solved, it was an Excel problem

    Posted 14 years ago #
  10. aolmos
    Member

    Now I have version 4, and found the same problem. What can I do?

    Posted 10 years ago #

RSS feed for this topic

Reply