How can I change date from 24-hours format to 12-hours format (am/pm) in android

后端 未结 7 627
Happy的楠姐
Happy的楠姐 2021-01-14 16:56
Calendar ci = Calendar.getInstance();

CiDateTime = \"\" + (ci.get(Calendar.MONTH) + 1) +  
    \"/\" + ci.get(Calendar.DAY_OF_MONTH) + 
    \"/\" + ci.get(Calendar.         


        
相关标签:
7条回答
  • 2021-01-14 17:33

    hh:mm a

    Adding the 'a' should do the trick in displaying the am/pm

    In angular i am using angular-bootsrap-datetimepicker and to display the selected date and time i am using this syntax

    data-ng-model="event.start | date:'dd-MM-yyyy hh:mm a'"

    0 讨论(0)
提交回复
热议问题