Skip to content

Commit

Permalink
fix date timestamps
Browse files Browse the repository at this point in the history
it needed to be stored as seconds instead of milliseconds
  • Loading branch information
fridge7809 committed Feb 17, 2024
1 parent ccdacee commit afeefc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routes/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ router.post('/add_message', requireAuth, async function (req, res, next) {
try {
const userId = req.session.username.id;
const messageContent = req.body.text;
const currentDate = new Date().getTime();
const currentDate = Math.floor(new Date().getTime() / 1000);
await userService.addMessage(userId, messageContent, currentDate);
res.redirect('/')
} catch (error) {
Expand Down

0 comments on commit afeefc4

Please sign in to comment.