Add postgresql compatibility

This adds postgresql compatibility to the date_entered test. Based off of include/functions.php.