Translate

Wednesday, 29 November 2017

c# get AM or PM from DateTime

use this namespace


using System.Globalization;

string amOrPmvalue=DateTime.Now.ToString("tt", CultureInfo.InvariantCulture);
Response.Write(amOrPmvalue);

No comments:

Post a Comment