Translate

Friday, 28 September 2018

c# date format dd/MM/yyyy hh:mm AM/PM

today in format : 28/09/2018 7:18 PM

c# code: DateTime.Now.ToString("dd/MM/yyyy h:mm tt")

The Other format for today is as follows


DateTime.Now.ToString("MM/dd/yyyy") Result : 09/28/2018


DateTime.Now.ToString("dddd, dd MMMM yyyy"): Result : Friday, 28 September 2018


DateTime.Now.ToString("dddd, dd MMMM yyyy HH:mm:ss"): Result : Friday, 28 September 2018 19:36:45


DateTime.Now.ToString("MM/dd/yyyy HH:mm"): Result : 09/28/2018 19:36


DateTime.Now.ToString("MM/dd/yyyy hh:mm tt"): Result : 09/28/2018 07:36 PM


DateTime.Now.ToString("MM/dd/yyyy H:mm"): Result : 09/28/2018 19:36


DateTime.Now.ToString("MM/dd/yyyy h:mm tt"): Result : 09/28/2018 7:36 PM


DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"): Result : 09/28/2018 19:36:45


DateTime.Now.ToString("MMMM dd"): Result : September 28


DateTime.Now.ToString("yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss.fffffffK"): Result : 2018’-‘09’-‘28’T’19’:’36’:’45.4574160-07:00


DateTime.Now.ToString("ddd, dd MMM yyy HH’:’mm’:’ss ‘GMT’"): Result : Fri, 28 Sep 2018 19’:’36’:’45 ‘G9T’


DateTime.Now.ToString("yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss"): Result : 2018’-‘09’-‘28’T’19’:’36’:’45


DateTime.Now.ToString("HH:mm"): Result : 19:36


DateTime.Now.ToString("hh:mm tt"): Result : 07:36 PM


DateTime.Now.ToString("H:mm"): Result : 19:36


DateTime.Now.ToString("h:mm tt"): Result : 7:36 PM


DateTime.Now.ToString("HH:mm:ss"): Result : 19:36:45


DateTime.Now.ToString("yyyy MMMM"): Result : 2018 September

No comments:

Post a Comment