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.

Re: how o convert system time into integer????? 80 80

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

Re: how o convert system time into integer????? 80 80

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 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.