当前位置:网站首页>Get hours, minutes and seconds
Get hours, minutes and seconds
2022-07-26 02:24:00 【Hide roses on your back】
Get the timestamp
// Get the timestamp
function getTime() {
const timezone = 8; // Target time zone time , East eight Positive number of Eastern time zone Negative number of Xishi District
const offset_GMT = new Date().getTimezoneOffset(); // The difference between local time and Greenwich mean time , In minutes
const nowDate = new Date().getTime(); // Local time interval 1970 year 1 month 1 Midnight (GMT Time ) The number of milliseconds between
const targetDate = new Date(
nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000
);
const time = targetDate.getTime();
return time;
}Get the timestamp
Date.now()
1658748281671Gets the minutes and seconds of the year, month and day
// Get date Minutes and seconds
getCurrentTime() {
var myDate = new Date();
var nowDate =
myDate.getFullYear() +
"-" +
(myDate.getMonth() + 1) +
"-" +
myDate.getDate() + " "+ myDate.getHours()+ ":"+myDate.getMinutes()+':'+myDate.getSeconds()
const cunrentTime = nowDate;
return cunrentTime
},Get date Minutes and seconds And the current day of the week
function time() {
var vWeek, vWeek_s, vDay;
vWeek = [" Sunday ", " Monday ", " Tuesday ", " Wednesday ", " Thursday ", " Friday ", " Saturday "];
var date = new Date();
year = date.getFullYear();
month = date.getMonth() + 1;
day = date.getDate();
hours = date.getHours();
minutes = date.getMinutes();
seconds = date.getSeconds();
vWeek_s = date.getDay();
console.log( year + " year " + month + " month " + day + " Japan " + "\t" + hours + ":" + minutes + ":" + seconds + "\t" + vWeek[vWeek_s]);
};
setInterval("time()", 1000);
边栏推荐
- i. Mx6ull snvs power domain GPIO status hold verification
- 栈题目:文件的最长绝对路径
- Ti am335x industrial control module uses the Debian system of beaglebone (BBB)
- (CVPR 2019) GSPN: Generative Shape Proposal Network for 3D Instance Segmentation in Point Cloud
- National standard gb28181 protocol video platform easygbs message pop-up mode optimization
- Activiti workflow gateway
- Product thinking drives the construction of R & D management tools
- 020-024 polymorphism review
- 我来图书馆小程序一键签到和一键抢位置工具
- [early knowledge of activities] list of recent activities of livevideostack
猜你喜欢

租户问题。

Niuke net question brushing training (I)
![[early knowledge of activities] list of recent activities of livevideostack](/img/14/d2cdae45a18a5bba7ee1ffab903af2.jpg)
[early knowledge of activities] list of recent activities of livevideostack

Kaggle registration method to solve the problem of man-machine verification

I.MX6UL核心模块使用连载-查看系统信息 (二)

Bo Yun container cloud and Devops platform won the trusted cloud "technology best practice Award"

Obsidian mobile PC segment synchronization
![[2021] [paper notes] 6G technology vision - otfs modulation technology](/img/50/577ad05bc16e80d1c68eec7b6da988.png)
[2021] [paper notes] 6G technology vision - otfs modulation technology

(Dynamic Programming Series) sword finger offer 48. the longest substring without repeated characters

1. Mx6ul core module use serialization - view system information (II)
随机推荐
[pyqt5 packaged as exe]
我来图书馆小程序一键签到和一键抢位置工具
(Dynamic Programming Series) sword finger offer 48. the longest substring without repeated characters
Slow query log in MySQL
I.MX6UL核心模块使用连载-以太网测试 (七)
[2021] [paper notes] biological effects of cell membrane under infrared and THz - effect is a phenomenon, action is a mechanism - the benefits of THz to medicine
Recorded target detection NMS (non maximum suppression)
Handling process of the problem that the virtual machine's intranet communication Ping fails
微信小程序解密并拆包获取源码教程
I.MX6UL核心模块使用连载-查看系统信息 (二)
Li Kou daily question - day 39 -67. Binary sum
必会面试题:1.浅拷贝和深拷贝_深拷贝
Obsidian mobile PC segment synchronization
流形学习、、
Acwing 379. hide and seek problem solution (minimum path non repeating point coverage)
prometheus+redis-exporter+grafana 监控redis服务
Effectively solve the problem of garbled code when idea runs the web project (with detailed steps)
Sword finger offer 28. symmetric binary tree
17_ Form Data
18. Delete the penultimate node of the linked list