当前位置:网站首页>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


边栏推荐
- Why do I need to wait for 2msl?
- 2022夏暑假每日一题(五)
- NB-IoT产业的现状与未来:跨过1亿出货门槛,奔向5G大连接!
- Ideas, methods and steps of making folding fans with 3DMAX
- 硬布线控制器的特点:
- Under the epidemic, TSMC's growth in the first quarter exceeded expectations, with 7Nm accounting for 35%! Second quarter or record high
- Which one is better to request to merge -- three skills of interface request merging, and the performance directly explodes the table
- Accelerate IGBT localization! BYD semiconductor will be listed independently, with a market value of 30billion yuan!
- [C language] address book (dynamic version)
- 远程调试 idea配置remote debug、在远程服务器的程序中,添加JVM启动参数-Xdebug
猜你喜欢

Reinforcement learning - pytorch realizes advantage actor critical (A2C)

NDK series (6): let's talk about the way and time to register JNI functions

CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021

五子棋人机对战实现

尚硅谷尚品项目汇笔记(一)

技术认证 | 图扑软件携手华为云再创合作共赢新局面

The first activity of togaf10 standard reading club was successfully held, and the wonderful moments were reviewed!

主数据管理理论与实践
Software test function test full set of common interview questions [function test] interview summary 4-2

Lua基础语法学习
随机推荐
突发,微信重要通知
RPA流程自动化机器人是什么技术?如何实现办公自动化?
Interviewer: let's talk about the specific process of network data transmission
基于原生js实现今日新闻网站
Nature review: preferential effects in the formation of microbial communities
[NCTF2019]babyRSA1
How to use xshell Free Edition
Flutter pull_ to_ refresh-1.6.0/lib/src/internals/slivers. dart:164:13: Error: Method not found: ‘descr
ZCMU--1720: 死亡如风,我要装逼
Current situation and future of Nb IOT industry: cross the threshold of 100million shipments and rush to 5g connection!
JS提升:JS中的数组扁平化问题
主数据管理理论与实践
Redis的分布式锁
Socket interaction process of three handshakes
smartRefresh嵌套多个RecycleView滑动冲突及布局显示不全
采用汇顶屏下光学指纹方案,三星Galaxy A71 5G上市
如果我们是那晚负责修复 B 站崩了的开发人员
苹果发布新款iPhone SE:搭载A13仿生处理器,售价3299元起
Design and implementation of spark offline development framework
Sudden, wechat important notice