AndroidDev
AndroidDev

Reputation: 16385

MediaStore.Video.Media.DATE_MODIFIED format

Can anyone show me how to format the MediaStore.Video.Media.DATE_MODIFIED to the human readable date format. I read in the docs that the time is in seconds. So i simply multiply it by 1000 and use the SimpleDateFormat . Here is my code

    Date d=new Date(mills*1000);
    DateFormat df=new SimpleDateFormat("dd-mm-yyyy");
    df.setTimeZone(TimeZone.getTimeZone("UTC"));
    return df.format(d);

This returns a String 25-35-2012 that off course is not correct. Any help with this ?

Kind Regards

Upvotes: 0

Views: 584

Answers (1)

Aprian
Aprian

Reputation: 1728

you should use capital M, m refers to minute in hour while M refer to Month in year.

see this for further info

Upvotes: 1

Related Questions