- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
假设是 32 位操作系统/浏览器,如果我将日期设置为 2038 年之后,用 JavaScript 创建的 Date 对象是否可以翻转到 1970 年?
Mozilla documentation说一年可以设置为 9999,但是我不知道这是否在所有 JavaScript 实现中都是一致的,或者这是否是对规范规定内容的准确描述。
我认为根据文档中的措辞,它似乎要么使用 64 位数字来存储时间,要么以 ISO 日期格式存储实际数据。
有谁知道浏览器是如何实现的?
最佳答案
根据ECMAScript specification,这不应该是第 15.9.1.1 节:
Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC. Leap seconds are ignored. It is assumed that there are exactly 86,400,000 milliseconds per day. ECMAScript number values can represent all integers from –9,007,199,254,740,991 to 9,007,199,254,740,991; this range suffices to measure times to millisecond precision for any instant that is within approximately 285,616 years, either forward or backward, from 01 January, 1970 UTC.
The actual range of times supported by ECMAScript Date objects is slightly smaller: exactly –100,000,000 days to 100,000,000 days measured relative to midnight at the beginning of 01 January, 1970 UTC.
This gives a range of 8,640,000,000,000,000 milliseconds to either side of 01 January,1970 UTC. The exact moment of midnight at the beginning of 01 January, 1970 UTC is represented by the value +0.
关于javascript - JavaScript 的 Date 对象容易受到 Y2038 问题的影响吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1608108/
所以我试图让(例如)输入一些值:1 -2 -3 2 5正数的数量是 5 负数的数量是 -3总计为 3 平均值为 0.6我想让它像这样,但是当我运行它时,它不起作用哪一部分是错误的??? import
我编写了一个使用 OpenCV 的 cvCalcOpticalFlowLK 的程序。它在低分辨率网络摄像头输入上表现良好,但我需要在全高清流上运行它,并在对每一帧进行光流分析后进行重要的其他计算。处理
如果我有一个 ruby 脚本 Daemon,顾名思义,它作为守护进程运行,监视系统的各个部分并能够执行需要身份验证的命令,例如更改权限,是否存在一个简单的方法来拥有第二个 ruby 脚本,比如
我们有一个基于 Ant 和 Ivy 的构建管理系统,它基本上由一个共享的 ant 文件和一组围绕目录结构的约定组成。 我试图克服的一个障碍是相当常见的“递归发布”情况。比如说,我们有 5 个内部代码模
我在嵌入式 Linux 环境中遇到了问题。尝试确定它是否可以由应用程序引起。应用程序导致内核崩溃/锁定或终止 init 有多容易? 最佳答案 非根应用程序应该不可能影响任何一个。 以 root 身份运
我目前正在尝试学习 Nim(进展缓慢 - 无法投入太多时间)。另一方面,为了获得一些工作代码,我想对我正在 ruby 中开发的 Nim 应用程序的各个部分进行原型(prototype)设计。 由于
我是一名优秀的程序员,十分优秀!