///
/// The date time format specifier.
///
private const string DateTimeFormatSpecifier = "yyyy-MM-ddTHH\\:mm\\:ss.fffZ";
///
/// Method to obtain the current date time with millisecond resolution.
///
protected void GetDateTimeNow()
{
DateTime value = DateTime.UtcNow;
string dateTimeValueInMs = value.ToString(
DateTimeFormatSpecifier,
DateTimeFormatInfo.InvariantInfo);
Console.WriteLine(String.Format("The current date time in milliseconds is : {0}", dateTimeValueInMs));
}
No comments:
Post a Comment