Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

how do i format date in java

Open 1 Answers 31 Views Programming
0 1
I have a date in Java. I need to format it in below format. YYYY-MM-DD hh_mm. How do I format that?

1 Answer

This is what you're looking for.


SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH_mm");
        return simpleDateFormat.format(new Date());
answered by (151 points)
commented by
Is it possible to use java Hibernate to connect to the database in Selenium Webdriver instead of using JDBC ? If yes, can you show an example of the connection configuration? Thanks
commented by (151 points)
Please post this as a new question so other visitors can get benefited of answers as well.

If you would like to register, use below link.

Much appreciated.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.