Пример #1
0
        ///// <summary>
        /////  美股时间转换
        ///// </summary>
        ///// <param name="buffer"></param>
        ///// <returns></returns>
        public static long GetUsTimestamp(byte[] buffer)
        {
            var a = HexStringUtil.ByteArrayTo16String(buffer);
            var b = Convert.ToInt64(a, 16);

            return(b / 1000 / 1000);
        }
Пример #2
0
        /// <summary>
        ///  美股时间转换
        /// </summary>
        /// <param name="buffer"></param>
        /// <returns></returns>
        public static long GetUsDataTimestamp(byte[] buffer)
        {
            var a    = HexStringUtil.ByteArrayTo16String(buffer);
            var b    = Convert.ToInt64(a, 16);
            var date = Utils.GetUsTimeDateSpan();
            var c    = date + (b / 1000 / 1000);

            return(c);
        }
Пример #3
0
        /// <summary>
        /// 美股时间转换
        /// </summary>
        /// <param name="buffer"></param>
        /// <returns></returns>
        public static string GetUsDateTimeToStr(byte[] buffer)
        {
            var a    = HexStringUtil.ByteArrayTo16String(buffer);
            var b    = Convert.ToInt64(a, 16);
            var date = Utils.GetUsTimeDateSpan();
            var c    = date + (b / 1000 / 1000);
            var time = Utils.GetTime(c);

            return(time.ToString("HH:mm:ss:ffff"));
        }