Menu

#26 Date fields are mangled.

open
nobody
None
5
2005-03-24
2005-03-24
Anonymous
No

Date fields formatted as mm/dd/yy or mm/dd/yyyy are
mangled (example: 03/02/05 became 03/0202/0505) on import.

Discussion

  • JDub

    JDub - 2007-03-07

    Logged In: YES
    user_id=1737735
    Originator: NO

    I'm currently experiencing the same problem. Dates either come out mangled or the day of the date has been subtracted by 1 (11/25/2006 becomes 11/24/2006)

     
  • Nobody/Anonymous

    Logged In: NO

    Just as a temporary solution for mm/dd/yyyy format do the following:
    Find the folorwing string in reader.php file "preg_match("/[^hmsday\/\-:\s]/i", $formatstr)"

    Under it, you will find the folowing code:
    $isdate = TRUE;
    $formatstr = str_replace('mm', 'i', $formatstr);
    $formatstr = str_replace('h', 'H', $formatstr);

    replace it with the following:
    $isdate = TRUE;
    $formatstr = str_replace('mm', 'm', $formatstr);
    $formatstr = str_replace('dd', 'd', $formatstr);
    $formatstr = str_replace('yy', 'Y', $formatstr);
    $formatstr = str_replace('h', 'H', $formatstr);

     
  • Nobody/Anonymous

    A problem is that MM is the same in DATE format and TIME format.

    I used this code to fix DATE and TIME formats:

    $search = array( 'YYYY','/MM','DD','HH',':MM','SS');
    $replace = array('Y','/m','d','H',':i','s');
    $formatstr = str_ireplace($search, $replace, $formatstr);

     

Log in to post a comment.