Skip to content

Commit

Permalink
Convert timestamp to string in save function of OceanData class
Browse files Browse the repository at this point in the history
  • Loading branch information
Sowri19 committed Apr 16, 2024
1 parent 8300885 commit 81e79ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/oceanData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const tableName = "OceanData";
class OceanData {
async save(data) {
const { deviceId, sensorData } = data;
const timestamp = Date.now();
const timestamp = Date.now().toString(); // Convert timestamp to string

// If deviceId is not provided, generate a new one
const id = deviceId ? deviceId : uuidv4();
Expand All @@ -24,7 +24,7 @@ class OceanData {
WaterPressure: sensorData.WaterPressure,
AirPressure: sensorData.AirPressure,
UVLevels: sensorData.UVLevels,
timestamp,
timestamp: timestamp, // Store timestamp as string
},
],
},
Expand Down

0 comments on commit 81e79ca

Please sign in to comment.