这个网站的cookie值为何不对?

这条记录是我从firefox读取的某个网站cookie信息,部分数据
字段含义
7|expiry|INTEGER|0||0
8|lastAccessed|INTEGER|0||0
9|creationTime|INTEGER|0||0
10|isSecure|INTEGER|0||0
11|isHttpOnly|INTEGER|0||0
12|inBrowserElement|INTEGER|0|0|0
13|sameSite|INTEGER|0|0|0

firefox中的某个网站cookie的部分信息

|1595989870|1564453870502728|1560301105695650|0|0|0|0

expire
php > echo date('Y-m-d H:i:s',strtotime("1595989870"));
1970-01-01 08:00:00

lastAccessed
php > echo date('Y-m-d H:i:s',strtotime("1564453870502728"));
1970-01-01 08:00:00

creationTime
php > echo date('Y-m-d H:i:s',strtotime("1560301105695650"));
1970-01-01 08:00:00

为何这个转换后的值都一样,我错在哪里了?

阅读 1.8k
2 个回答

错在乱用strtotime

楼上说的是对的,strtotime是将 时间字符串 转为 时间戳。你填进strtotime的全是时间戳……

推荐问题