DeepeshKalura
DeepeshKalura13mo ago

DateTime Stamp in convex

how can create the timestamp datatype in convex for field ended_at, similar to auto field _createdTime
6 Replies
Omar
Omar13mo ago
This is Unix time.
Omar
Omar13mo ago
ui.dev
How to get the current timestamp in JavaScript
In this post you'll learn a quick and easy solution for getting the current timestamp in JavaScript.
DeepeshKalura
DeepeshKaluraOP13mo ago
I don't understand why this logical error is occurring. i wait for 10 second // console.log("wait for 10 seconds"); setTimeout(async function () { var res = await client.mutation(api.session.createdNewThread, { id: response, message: "Hello", response: "Hi", sentiment_compound: 0.5 }); var re = await client.mutation(api.session.updateLastTime, { id: response }) console.log(res); console.log(re); }, 1000); by this getting in output is Difference in seconds: 9.100846435546876 0.9 second error ??
DeepeshKalura
DeepeshKaluraOP13mo ago
No description
DeepeshKalura
DeepeshKaluraOP13mo ago
that how i generate var lt = Math.floor(Date.now());
lee
lee13mo ago
Can you provide more of your code? Your comment says "wait for 10 seconds" but the setTimeout is for 1 second. it's not clear where "Difference in seconds" is coming from. you said difference in seconds is 9, then you said it's 0.9 seconds

Did you find this page helpful?