Skip to content

Commit

Permalink
timestamp bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vicwere committed Mar 5, 2024
1 parent 67a5c9a commit 43be07b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions routes/receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,17 @@ const timestamp_unix = req.body.timestamp;


// Extract the different components of the date
const year = timestamp_unix(0,4);
const year = timestamp_unix.substring(0,4);
const month =timestamp_unix.substring(4, 6); // Months are 0-based
const day = timestamp_unix.substring(6, 8);
const hours = timestamp_unix.substring(8, 10);
const minutes = timestamp_unix.substring(10, 12);
const seconds = timestamp_unix.substring(12, 14);

// Create a string representation of the date and time
const timestamp = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
const timestamp = year+'-'+ month+'-'+day+' '+hours+':'+minutes+':'+seconds;

console.log(timestamp);

let facility_attributes = {
"timestamp": timestamp,
Expand Down

0 comments on commit 43be07b

Please sign in to comment.