GPS时间转换北京时间

  • Post author:
  • Post category:其他


注:GPS起始时间为1980-01-06 00:00:00

//week = GPS周数  604800000L = 周毫秒 315936000000L = 1980-01-06 00:00:00
long weekms = week * 604800000L + 315936000000L;
//gpssec = 周秒,weekms周毫秒为UTC时间,需+8小时-18闰秒
long bjTime = ((long)(gpssec * 1000)) + weekms + 8 * 60 * 60 * 1000 - 18000;



版权声明:本文为lalalaqin原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。