当前位置:网站首页>Use of date
Use of date
2022-07-27 23:48:00 【yibucuo】
ECMAScript Of Date Type reference Java In earlier versions java.util.Date. So ,Date Type will date
Save as self coordinated universal time (UTC,Universal Time Coordinated) Time 1970 year 1 month 1 Midnight ( zero hour ) So far
Milliseconds elapsed . Using this storage format ,Date Types can be expressed precisely 1970 year 1 month 1 Before and after 285 616 Year of
date .
To create a date object , Just use new Operator to call Date Constructors :
Date.now();
let date1 = new Date(2019, 0, 1); // 2019 year 1 month 1 Japan
let date2 = new Date(2019, 1, 1); // 2019 year 2 month 1 Japan
var date = new Date()
console.log(date.getFullYear());//2022
console.log(date.getMonth());//6 It's actually 7 month
console.log(date.getDate());//27
console.log(date.getDay());//3
console.log(date.getHours());//9
console.log(date.getMinutes());//25
console.log(date.getSeconds());//15
console.log(date.getMilliseconds());//904
console.log(date.getTime());//1658885190098
console.log(Date.now());// 1658885190098
console.log(new Date(2022, 6).getMonth()); // 6
console.log(new Date(2022, 6).getDate()); // 1
console.log(new Date(2022, 6, 0).getDate()); // In fact, it represents 6 Monthly 30 God
console.log(new Date(2022, 7, 0).getDate()); // In fact, it represents 7 Monthly 31 God
console.log(new Date(2022, 12, 0).getDate()); // In fact, it represents 12 Monthly 31 God
console.log(new Date(2022, 14, 0).getDate()); // In fact, it represents 2023 year 2 Monthly 28 God


边栏推荐
- Binary conversion method
- Solve 5g pain points, Meizu 17 smart 5g fast and stable technology release
- TCP的粘包拆包问题+解决方案
- The total investment is 60billion! Foxconn semiconductor high-end package test project officially settled in Qingdao
- 用3dmax做折扇的思路方法与步骤
- Sudden, wechat important notice
- [RoarCTF2019]RSA
- CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021
- 数据管理的重点
- [NPUCTF2020]EzRSA
猜你喜欢

基于mediapipe的姿态识别和简单行为识别

C # delegate usage -- console project, which implements events through delegation

Redefine analysis - release of eventbridge real-time event analysis platform

远程调试 idea配置remote debug、在远程服务器的程序中,添加JVM启动参数-Xdebug

低代码开发前景如何,大家都真的看好低代码开发吗?

【C语言】通讯录(动态版本)

Record the errors about formatc in R language

Introduction to several common usage scenarios of message queue

字符流学习14.3

Realize today's news website based on native JS
随机推荐
TFRecord的Shuffle、划分和读取
proteus仿真arduino中调用DHT11/22温湿度传感器
硬布线控制器的特点:
Interviewer: let's talk about the specific process of network data transmission
Using the optical fingerprint scheme under the huiding screen, Samsung Galaxy a71 5g is listed
Join hands with Changjiang storage, jiangbolong launches the world's smallest expansion card
如果我们是那晚负责修复 B 站崩了的开发人员
Solve 5g pain points, Meizu 17 smart 5g fast and stable technology release
Arm32进行远程调试
突发,微信重要通知
【C语言】通讯录(动态版本)
Redefine analysis - release of eventbridge real-time event analysis platform
Unity 实现简单画板画画功能(笔记)
[MRCTF2020]babyRSA
Can Siemens PLC collect analog data of multiple slave stations in real time and wirelessly?
为什么需要等待计时2MSL?
smartRefresh嵌套多个RecycleView滑动冲突及布局显示不全
TSMC 3nm detail exposure: transistor density as high as 250million /mm ², Greatly improved performance and energy efficiency
Master data management theory and Practice
Key points of data management