当前位置:网站首页>JS gets the year, month, day, time, etc. of the current time
JS gets the year, month, day, time, etc. of the current time
2022-08-10 04:29:00 【weixin_43923808】
var date = new Date();date .getYear(); //Get the current year (2 digits)date .getFullYear(); //Get the full year (4 digits)date .getMonth(); //Get the current month (0-11, 0 represents January)date .getDate(); //Get the current day (1-31)date .getDay(); //Get the current week X (0-6, 0 represents Sunday)date .getTime(); //Get the current time (the number of milliseconds since 1970.1.1)date .getHours(); //Get the current hour (0-23)date .getMinutes(); //Get the current minute (0-59)date .getSeconds(); //Get the current number of seconds (0-59)date .getMilliseconds(); //Get the current number of milliseconds (0-999)date .toLocaleDateString(); //Get the current datevar mytime=date .toLocaleTimeString(); //Get the current timedate .toLocaleString( ); //Get the date and time
边栏推荐
猜你喜欢
随机推荐
微信公众号开发
PID与ADRC
【MindSpore功能】运行SSD-MobileNetV1 FPN样例报错
webrtc学习--webrtc源码获取
2022年P气瓶充装操作证考试题库及模拟考试
用 PySpark ML 构建机器学习模型
GBase 8s迁移失败
2022G3锅炉水处理考试模拟100题及模拟考试
cmake
关于rust的mongodb驱动count方法无法与near条件一同使用的问题
LeetCode·301.删除无效的括号·BFS
sql注入之宽字节注入,limit,order by
webrtc学习--websocket服务器
2022山东省安全员C证考试题及模拟考试
TCP协议之《QUICKACK模式》
移动端vw适配记录
C语言结构体初识
webrtc学习--webrtc桌面采集
ZZULIOJ:1018: 奇数偶数
Promise原理及实现