phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002917phplist applicationAll Otherpublic10-04-05 22:1008-07-05 16:06
Reportercrumrine 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version2.8.12 
Target VersionFixed in Version2.9.5 
Summary0002917: MySQL 4.1+ TIMESTAMP SQL Change
DescriptionWith the release of MySQL 4.1, timestamps no longer return as a timestamp (I wonder what they were thinking). They now return as a datetime in a query.

http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html [^]

Look for "Incompatible change: TIMESTAMP"

This was really obvious in the admin/userhistory.php as the event timestamps parsed incorrectly.

I made a quick change to my code - added a check for a timestamp (which should be numeric) and parse a timestamp if it's not - could probably just pass that through though as it's really close.

function niceDateTime($datetime) {
    if (is_numeric($datetime)) {
        $year = substr($datetime,0,4);
        $month = substr($datetime,4,2);
        $day = substr($datetime,6,2);
        $hr = substr($datetime,8,2);
        $min = substr($datetime,10,2);
    } else {
        $year = substr($datetime,0,4);
        $month = substr($datetime,5,2);
        $day = substr($datetime,8,2);
        $hr = substr($datetime,11,2);
        $min = substr($datetime,14,2);
    }
    return date("D M j G:i T Y",mktime($hr,$min,0,$month,$day,$year));
}

I did notice this function also existed in user.php. I haven't looked beyond this for timestamp parsing functions.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to 0002457resolvedmichiel PHPList v2.9.5 release 
has duplicate 0003116resolvedmichiel niceDateTime in userhistory.php incorrect. 

-  Notes
(0005575)
michiel (manager)
08-07-05 16:06

resolved by requesting the formatting from Mysql instead using date_format(time,"%e %b %Y %T")


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker