I want to convert Long value to String or Date in this format dd/mm/YYYY.
I have this value in Long format: 1343805819061.
It is possible to convert it to Date format?
I want to convert Long value to String or Date in this format dd/mm/YYYY.
I have this value in Long format: 1343805819061.
It is possible to convert it to Date format?
Here timeStamp is your long integer which is actually timestamp in millieseconds, you get the java date object, now you can convert it into string by this
You can use below line of code to do this. Here timeInMilliSecond is long value.
Or you can use below code too also.
Reference:- DateFormat and SimpleDateFormat
P.S. Change date format according to your need.
You can use method setTime on the Date instance or the contructor Date(long);
Then use the simple date formater
see http://docs.oracle.com/javase/1.4.2/docs/api/javax/swing/text/DateFormatter.html