Languages

Menu
Sites
Language
How to get time in 12 hrs format in tizen native app

SystemTime::GetCurrentTime(TIME_MODE_WALL, standardTime);
    title.Append(standardTime.ToString());

It is showing 24hrs format.

I need to show in hh:mm am/pm and date in dd/mm/yyyy

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

1 Replies
konduri sai swathi
Hi Shital, If you change the time format of emulator to 12-hour in settings then you the result of GetCurrentTime() in 12-hour format. Or else you have to manipulate your code so that the time will be displayed in 12-hour i.e if hours is >12 then subtract it by "12". Or refer this link to format date and time : https://developer.tizen.org/help/topic/org.tizen.native.apireference/classTizen_1_1Locales_1_1DateTimeFormatter.html . Following the syntax from https://developer.tizen.org/help/topic/org.tizen.native.appprogramming/html/guide/locales/date_time_syntax.htm?resultof=%22%31%32%22%20%22%68%6f%75%72%22%20%22%66%6f%72%6d%61%74%22%20 when you format the time and date, specify "h" (lowercase) then you can display time in 12-hour format.