当前位置:网站首页>Ext JS的数字类型处理及便捷方法
Ext JS的数字类型处理及便捷方法
2022-07-17 01:23:00 【oscar999】
JavaScript的Date类型
时间对象的创建
创建日期对象的方式:
myDate = new Date();
myDate = new Date("December 19, 1983 03:24:00");
myDate = new Date(1983,11,19);
myDate = new Date(1983,11,17,3,24,0);
- 没有参数则是创建一个当前的日期
- 可以使用当地时间子串作为参数;也可以传入年月日作为参数; 也可以传入年月日,时分秒作为参数。
Date
- 时间可以转换为一个以毫秒为单位的数, 转换是以国际标准时间(UTC)的1970年1月1日午夜为起始点。一天的毫秒数是 246060*1000 = 86,400,000。
- Date类型的日期是有时间范围的, 以1970年1月1日为中心点, 向前和向后的 100,000,000 天。
- Date类型的日期支持多种时间格式, 比如UTC,GMT等
获取时间毫秒数的方式:
方式1: 使用类的静态方法 : Date.now();
//2. 获取时间的毫秒数
var dateMilSecs = Date.now();
console.log(dateMilSecs);
方式2: 使用对象的getTime() 方法
var date = new Date();
dateMilSecs = date.getTi边栏推荐
- Data source object management (third-party object resources) & load properties file
- Bisenetv1 face segmentation
- 論文閱讀:U-Net++: Redesigning Skip Connections to Exploit Multiscale Features in Image Segmentation
- Unity解决同材质物体重叠产生Z-Fighting的问题
- Polynomial interpolation fitting (III)
- 367. Effective complete square (necessary for entry)
- Flutter开发:运行flutter upgrade命令报错Exception:Flutter failed to create a directory at…解决方法
- Ncnn mat matrix class
- Shell script receives and returns parameters
- 我最高产的EasyPyPI又双叒叕更新了!v1.4.0发布
猜你喜欢

leetcode:50. Pow(x, n)

Transaction and storage engine in MySQL database

Several methods of face detection

通过OpenHarmony兼容性测评,大师兄开发板与丰富教培资源已ready

Polynomial interpolation fitting (II)

MySQL interview questions (2022)
![Theoretical basis of doubledqn and its code implementation [pytoch + pendulum-v0]](/img/f2/4a3cc8e5173789111080915aceb9fd.png)
Theoretical basis of doubledqn and its code implementation [pytoch + pendulum-v0]

374. 猜数字大小(入门 必会)

Authentication code for wireless

爬虫学习(5):手把手教你爬虫requests实战演练
随机推荐
Polynomial interpolation fitting (I)
In depth understanding of machine learning - unbalanced learning: sample sampling technology - [smote sampling method and borderline smote sampling method of manual sampling technology]
MySQL 增删查改(基础)
Wechat applet
Simple usage and interface introduction of labelme
Bisenetv2 face segmentation ncnn reasoning
Zabbix6.0 monitoring vcenter7.0
Yolov5 opencv DNN reasoning
We should increase revenue and reduce expenditure
MySQL optimized index
The WinRAR command copies the specified folder as a compressed file, and calls the scheduled task for backup.
leetcode:50. Pow(x, n)
It's good to take more exercise
Authentication code for wireless
ES6学习笔记——B站小马哥
Rhce8 Learning Guide Chapter 1 installing rhel8.4
代理模式——B站动力节点
洛谷每日三题之第五天
The installation software prompts that the program input point adddlldirectory cannot be located in the dynamic link library kernel32 DLL (download address at the end of the text)
ES6學習筆記——B站小馬哥