Hi wondering how to create a timestamp in c# using Datetime values, use the method below.
public static String GetTimestamp(this DateTime value)
{
return value.ToString("yyyyMMddHHmmssffff");
}
Posts on .Net technology by Yasser R Shaikh. We have moved : http://yassershaikh.com/
Hi wondering how to create a timestamp in c# using Datetime values, use the method below.
public static String GetTimestamp(this DateTime value)
{
return value.ToString("yyyyMMddHHmmssffff");
}
2011 ·Code-Studio by yrus.
1 comments:
//Get UTC time in Hours,minutes,seconds,milliseconds(fractions) format
string utcTime = DateTime.UtcNow.ToString("HHmmss.ffff");
//Get UTC date in date,month,year format
string utcDate = DateTime.UtcNow.Date.ToString("ddMMyy");
Post a Comment