当前位置:网站首页>JS get the current date and time
JS get the current date and time
2022-07-25 23:21:00 【Intern Sen】
One 、 Gets the current date and time
const t = newDate(); // Tue Jul 05 2022 17:35:44 GMT+0800 ( China standard time )
1 Get full year (4 position ,1970—)
t.getFullYear(); // 2022
2 Get current year (2 position )
t.getYear(); // 122 (2022-1900)
3 Get current month (0-11,0 Express 1 month )
t.getMonth(); // 6
4 Get current day (1-31)
t.getDate(); // 5
5 Get the current day of the week (0-6,0 For Sunday )
t.getDay(); // 2
6 Get the current time ( from 1970.1.1 Milliseconds to start )
t.getTime(); // 1657014040374
7 Get current hours (0-23)
t.getHours(); // 17
8 Get current minutes (0-59)
t.getMinutes(); // 40
9 Get current seconds (0-59)
t.getSeconds(); // 40
10 Get current milliseconds (0-999)
t.getMilliseconds(); // 200
11 Get current date and time string
t.toLocaleString(); // '2022/7/6 09:51:14'
12 Get the current date string
t.toLocaleDateString(); // '2022/7/6'
13 Get the current time string
t.toLocaleTimeString(); // '09:51:14'
边栏推荐
- 新手开户选择哪个券商公司好呢?安全吗
- About priority queues
- Rental experience post
- 多模态——Deep Multi-Modal Sets
- Zcmu--5015: complete the task
- How does PHP remove an element from an array based on the key value
- TS basic data type
- Analysis of the influence of ESM direction finding error on positioning error
- 学习探索-波浪
- 向下扎根,向上生长,探寻华为云AI的“根”力量
猜你喜欢

How to set pseudo static for WordPress fixed links
![Explain in detail the addition (+) operation in JS, basic data type addition, reference data type addition, and the underlying operation rules, [] + {}, {} + []](/img/06/85a6ba450fc2637a4ac1cf6a630912.png)
Explain in detail the addition (+) operation in JS, basic data type addition, reference data type addition, and the underlying operation rules, [] + {}, {} + []

电商RPA,大促轻松上阵的法宝

动态内存管理

赋能合作伙伴,亚马逊云科技如何落地“扶上马,送一程”?

Solution of phpstudy service environment 80 port occupied by process system under Windows

Several commonly used traversal methods

Discuz atmosphere game style template / imitation lol hero League game DZ game template GBK

Unity 使用宏

Data broker understanding
随机推荐
VisualBox启动虚拟机报错:The VM session was closed before any attempt to power it on.
Check code generation
Summary of common PHP functions
Family relationship calculator wechat applet source code
@Autowired annotation required attribute
连续三年成为云AI服务领导者,亚马逊云科技做对了什么?
Discuz magazine / news report template (jeavi_line) utf8 GBK / DZ template download
Flight control implementation of four rotor aircraft "suggestions collection"
5 ROS simulation modeling (3-rviz+gazebo+ control simulation robot)
Firewall command simple operation
Unity uses macros
2021-09-30
Node基础
谷粒学苑P98踩坑 e.GlobalExceptionHandler : null
TS class
策略模式_
PHP binary array is sorted by a field in it
Multimodal deep multi modal sets
自定义mvc原理
OASYS system of code audit