Skip to content

Commit

Permalink
Changed date handling in upload.php
Browse files Browse the repository at this point in the history
my last commit was working but adding extra hours to the time. corrected to be simpler and just trim off the extra time stamp.
  • Loading branch information
paranoidsystems committed May 20, 2016
1 parent c4fabe6 commit d0f3bf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Web/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function sanitise_filename($filename) {
// Prepare INSERT QUERY
$sqlq = "INSERT INTO `data` (`timestamp`,`locationID`,`event`) VALUES (:rawtimestamp,:location,:count)";
$q = $DBH->prepare($sqlq);
$q->execute(array(':rawtimestamp' => date("Y-m-d H:i:s",(substr($rawtimestamp,17))), ':count' => $count, ':location' => $location));
$q->execute(array(':rawtimestamp' => (substr($rawtimestamp,0,19)), ':count' => $count, ':location' => $location));

// Error Handling
if (!$q) {
Expand All @@ -39,7 +39,7 @@ function sanitise_filename($filename) {
echo "</br>";
echo "Location: " . $location;
echo "</br>";
echo "Raw Timestamp: " . date("Y-m-d H:i:s",(substr($rawtimestamp,17)));
echo "Raw Timestamp: " . (substr($rawtimestamp,0,19));
exit;
}
}
Expand Down

0 comments on commit d0f3bf3

Please sign in to comment.