Wednesday, July 15, 2009

 

function to test dates

private void TestDates()
{
DateTime dt = DateTime.Now;
string timeHHMMSS = dt.ToString("HHmmss");

Console.WriteLine(dt);
Console.WriteLine(int.Parse(timeHHMMSS));
Console.WriteLine(timeHHMMSS);
TimeSpan ts = dt.TimeOfDay;
Console.WriteLine(ts.ToString());
timeHHMMSS = dt.ToString("HHmm");
Console.WriteLine(timeHHMMSS);
}
Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?