Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Java Date and Time Tutorial #33

64.9K views on YouTube

$1,500 OFF ANY Springboard Tech Bootcamps with my code ALEXLEE1500. See if you qualify for the JOB GUARANTEE! 👉 https://bit.ly/3HX970h

It’s very easy to get the current time in java! ✅ Simply write this piece of code and format it with SimpleDateFormat()

Java date website: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

You don’t have to calculate the time or anything yourself, this is how to get current date in java: Date d = new Date();

This way of calling the java current time can be a little tricky, but you’ll get the hang of it! They aren’t too bad 🙂 If you followed along, congrats! You learned-by-doing!

💻 Source Code: https://github.com/alexlorenlee/JavaTutorialCode/blob/master/Other/CurrentDate.java

I hope you enjoyed this tutorial on how to get the java date and java time! I like to have a nice mix of tutorials and actual projects for you all 🙂

Do you want to learn how to code from scratch, in Java? Check out my Java Tutorial For Beginners: https://youtu.be/woJb2hAfkO0

How are you using the time in java?

Full Java Tutorial For Beginners Playlist: https://youtube.com/playlist?list=PL59LTecnGM1NRUyune3SxzZlYpZezK-oQ&si=6OSbyiJxFsTjqL_9
Free Tips: https://bit.ly/3U6HXcb

Disclosure: Springboard link provided is linked to my affiliate account & supports the channel.

Alex Lee