i am making a program in java.
i am using the following code
u.setLastlogin(new java.util.Date());
above function accepts parameter as java.util.Date but i want to store this value in a database table where the column is of type timestamp?
can any one help how to code so that i can insert the current timestamp of the system in the table. thanks.
You can convert
DatetoTimestampas follows:And if you want timestamp of current date: