To Big Query Timestamp - CSharp System

CSharp examples for System:DateTime Timestamp

Description

To Big Query Timestamp

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from w w  w. ja va2  s  .co  m*/

public class Main{
        public static long ToBigQueryTimestamp(this DateTimeOffset target)
        {
            return (long)(target - unixEpochOffset).TotalMilliseconds * 1000;
        }
        public static long ToBigQueryTimestamp(this DateTime target)
        {
            return (long)(target - unixEpoch).TotalMilliseconds * 1000;
        }
}

Related Tutorials