Date parsing behavior
That seems like something for us to fix, thanks for pointing it out @CodingWithJamal. Be aware that built-in date parsing with either
new Date(s)
or Date.parse(s)
is inconsistent between runtimes (ie it works differently in Safari) so it's often not recommended.5 Replies
I think you can use
to get the same parsing behavior.
@CodingWithJamal in your case you dont' want a date object, so using
Date.parse(s)
which returns the datetime in milliseconds since epoch is more direct too;
oh okay i see. Thanks, I didnt understand the error and forgot about the runtime limitations
I will try this solution
okay this works now tom thanks
So im using sessions in the db to save user auth state, and when its created i wanted to create a schedule to delete the session and make sure the user has to re-login. Is this a good idea over convex cron-jobs?

@Tom
Yeah I think that's fine! You could also save the time that they logged in and anytime you check for session you check whether that time was in the last 24 hours: that way you can tell the difference between a session expiration and a never-before logged in session