you can do this

public String create_datestring(String timestring){
        try{
                final Calendar cal = Calendar.getInstance();
                cal.setTimeInMillis(Long.parseLong(timestring));
                timestring = String.valueOf(cal.get(Calendar.MONTH)+1) + "/" 
+String.valueOf(cal.get(Calendar.DAY_OF_MONTH)) + "/" + 
String.valueOf(cal.get(Calendar.YEAR));
        }catch(NumberFormatException e){
            timestring = "9/23/2011";--->timestring always returns 1 for month.
        } 

http://stackoverflow.com/questions/7554042/converting-timestamp-value-in-a-prticular-date-time-format


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to