using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XYY.Common.Standard
{
    public static class Timestamp
    {
        public static int GetUnix()
        { 
            System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
            return (int)(DateTime.Now - startTime).TotalSeconds;
        }

        public static long GetUnixLong()
        {
            //System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
            //return (long)(DateTime.Now - startTime).TotalMilliseconds;

            var b = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds();
            return b;
        }
    }
}
