当前位置:网站首页>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'
边栏推荐
- The new UI people help task help PHP source code with a value of 1500 / reward task Tiktok Kwai headline like source code / with three-level distribution can be packaged applet
- Summary of kotlin common knowledge points
- Apple CMS V10 template /mxone Pro adaptive film and television website template
- Dynamic memory management
- POI special effects Market Research
- 赋能合作伙伴,亚马逊云科技如何落地“扶上马,送一程”?
- [QNX hypervisor 2.2 user manual]9.7 generate
- Simulink学习笔记(三)——Simulink自动代码生成(二)「建议收藏」
- Wamp MySQL empty password
- Firewall command simple operation
猜你喜欢

E-commerce RPA, a magic weapon to promote easy entry

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

自定义mvc原理

File contains vulnerability

wordpress去掉网站发布时间

XxE & XML external entity injection utilization and bypass

Tips for using (1)

The new UI people help task help PHP source code with a value of 1500 / reward task Tiktok Kwai headline like source code / with three-level distribution can be packaged applet

Single model common sense reasoning first surpasses human beings! HFL summit openbookqa challenge

chown: changing ownership of ‘/var/lib/mysql/‘: Operation not permitted
随机推荐
Anaconda installation tutorial environment variables (how to configure environment variables)
新手哪个券商开户最好 开户最安全
Take away applet with main version of traffic / repair to add main access function of traffic
npm+模块加载机制
Secure code warrior learning record (II)
VisualBox启动虚拟机报错:The VM session was closed before any attempt to power it on.
Rendering, filtering (filtering) and sorting of lists
Wamp MySQL empty password
Mongodb features, differences with MySQL, and application scenarios
Unity uses macros
PHP binary array is sorted by a field in it
推荐系统——An Embedding Learning Framework for Numerical Features in CTR Prediction
WordPress controls the minimum and maximum number of words of article comments
Source code of YY music wechat applet imitating Netease cloud music
Summary of kotlin common knowledge points
Data broker understanding
MVVM model
5 ROS仿真建模(3- rviz+gazebo+控制仿真机器人)
网格参数化Least Squares Conformal Maps实现(3D网格映射到2D平面)
WebMvcConfigurationSupport