To find the current date in Javascript, you can use the Date() object. Here's an example code snippet:
index.tsx89 chars4 lines
This will create a new Date object with the current date and time. Then, we can use the getTime()
method to get the current timestamp in milliseconds.
Alternatively, you can also use the toUTCString()
method to get the current date in a readable format:
index.tsx93 chars4 lines
This will return something like "Tue, 05 Oct 2021 08:30:00 GMT".
gistlibby LogSnag