Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Never, ever use Javascript to figure out the current date.

It should be never use client dates. The developers should have sent a server UTC time code to the client and all JavaScript dates should have used that date as there seed. We actually create an extension of the standard JavaScript date in our projects which is seeded off of a server time so the time since epoc comes from the server. Further, they still should not trust the clients data as submitted and check to see if it is in range.



Exactly. Or, you could just use your server side language to stuff the server's date onto the template.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: