Cookies expiration time format

夙愿已清 提交于 2019-12-23 10:20:42

问题


I created DB from google chrome's Cookies file and one of the columns in the cookies table is expires_utc. The format of the column is like - 13169399213145330, which is more like unix time. But when i'm trying to use unix time converter, it gives wrong values.

So, what format is that and how i can convert it to actually unix time?


回答1:


So, after long researches on this topic, here is the solution:

  • Chrome's cookies timestap's epoch starts 1601-01-01T00:00:00Z (Why? Because.)

So, it's 11644473600 seconds before the UNIX epoch. To convert chrome's timestamp to UNIX, you need to:

  1. Devide the actual timestamp (in my case it's expires_utc column in cookies table) by 1000000 // And someone should explain my why.
  2. Subtract 11644473600
  3. DONE! Now you got UNIX timestamp.


来源:https://stackoverflow.com/questions/43518199/cookies-expiration-time-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!