Timestamps, Date.now( ) and valueOf( )

preview_player
Показать описание
There will be times with JavaScript when you need to get a timestamp to track when something happened or how long something took.
We have two options:
Both return a timestamp but it is important to understand the differences between them.
One other alternative that I did not mention in the video is that you can use the + unary operator to convert a Date into a timestamp.
let timestamp3 = +new Date( );
let today = new Date( );
let timestamp4 = +today;
Рекомендации по теме
Комментарии
Автор

Steve your an incredible and thoughtful/thorough teacher. Thank you for offering this all free of charge. Thank you for not pushing some 2000$ course at us. Just thanks dude. You are helping my dreams to be possible!

kenosabi
Автор

Always great to see your videos. Thanks Steve. Happy Belated Thanksgiving.

DmitriyMalayevProfile
Автор

Still useful 3-4 years ahead, and was exactly what I was looking for. Thank you!

Ddogwildone
Автор

hey Steve, thank you for your great videos, this is not obvious, and you are so relaxing with your voice!! i love your videos!!! thank you!!!

einatpilates
Автор

Thank you for this short yet precise explanations.

rotrose
Автор

Thanks for clear explanation. Can you please tell me how to get the format as - 202327032109(which means 2023(Year)-27(Date)-03(Month) -21(IST current time)-09(minutes)).Thank you!

divyalathamadapuri
Автор

Professor, can I implement this into a react app? I want to track transactions

Spookydigy
Автор

how to get timestamp for date in plotting charts that are generated from dynamic sql queires

yogeshnavathe
Автор

I prolly won't get a response, but what if I needed a date in the past? How would I plug this in the function?

xxdreadsaintxx
Автор

this was system date how to current date in javascript code

vickyvj
Автор

Hello brother, I am getting timestamp like this I want to convert it to hours and hr:mm:ss and show it in the html page. do you have any way?

aa-xkwp