System date & time is in SimpleDate format.
How can i convert this into integer?

"sdf.format(new Date(System.currentTimeMillis()))"............. I want to convert current time** into integer** data type.

Plz plz plz help me.
Any help for this is alwayz welcome.

Recommended Answers

All 2 Replies

Can you give an example? The currentTimeMillis() method returns a long representing the elapsed time from a fixed time.

Ok. I got the solution. SimpleDateFormat has method format() which gives answer in our specified format just like hh:mm:ss. There are other formats also. We can then convert it into any datataype which is convinient to use.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.