Gets the number of milliseconds needed to represent the DateTimeOffset. - CSharp System

CSharp examples for System:DateTime Second

Description

Gets the number of milliseconds needed to represent the DateTimeOffset.

Demo Code

// Copyright (C) 2006-2015 Esper Team. All rights reserved.                           /
using System.Text.RegularExpressions;
using System.Globalization;
using System;/*  w  ww.jav a  2 s  .co m*/

public class Main{
        /// <summary>
        /// Gets the number of milliseconds needed to represent
        /// the datetime.
        /// </summary>
        /// <param name="dateTime">The date time.</param>
        /// <returns></returns>
        public static long InMillis(this DateTimeOffset dateTime)
        {
            return DateTimeHelper.TicksToMillis(dateTime.UtcTicks) - DateTimeConstants.Boundary;
        }
}

Related Tutorials