Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<pre>Good Day! i want some help how can i get the mobile current datetime with the 12/24 format .Date and time e.g. April 17, 2020 - 1:15 PM. The date and the time should conform to the preferences the user has set on the device.Any one can help me with this.I need this in xamarin Forms.Thanks


What I have tried:

Response.Write("With Seconds" + "<br />");
    Response.Write("12 Hour Date Format : " + DateTime.Now.ToString("hh:mm:ss tt") + "<br />");
    Response.Write("24 Hour Date Format : " + DateTime.Now.ToString("HH:mm:ss tt") + "<br />");
    Response.Write("Without Seconds" + "<br />");
Posted
Updated 27-Jun-20 4:48am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900