How to convert Formatted date (yyyy-MM-dd) to Unix time in Java?
I want to declare a date using
Date birthday = new Date(y_birthday, m_birthday, d_birthday);
but this constructor has been deprecated, so I got to use the other constructor which uses Unix timestamp
So, you have the date as a string in the format
yyyy-MM-dd? Use ajava.text.SimpleDateFormatto parse it into ajava.util.Dateobject:edit If you need a
java.sql.Date, then you can easily convert yourjava.util.Dateto ajava.sql.Date: