CSharp examples for System:DateTime Second
Returns the current unix timestamp in milliseconds (UTC).
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;//from w w w . j a va2 s .co m public class Main{ /// <summary> /// Returns the current unix timestamp in milliseconds (UTC). /// </summary> /// <returns></returns> public static long GetCurrentTimestampInMilliseconds() { return (long)(DateTime.UtcNow - _posixTime).TotalMilliseconds; } }