当前位置:网站首页>Time and date formatting
Time and date formatting
2022-04-22 20:16:00 【Courtesy.】
Current time format (08:12:03)
// Output current time ( belt 0)
// 08:12:03
var date = new Date(),
function getTime(){
var time = new Date();
var h = time.getHours();
h = h < 10 ? '0' + h : h;
var m = time.getMinutes();
m = m < 10 ? '0' + m : m;
var s = time.getSeconds();
s = s < 10 ? '0' + s : s;
return h + ':' + m + ':' + s;
}
Format current date ( It's today :2022 year 4 month 22 Sunday, Friday )
var date = new Date(),
var year = date.getFullYear();
var month = date.getMonth() + 1;
var dates = date.getDate();
var arr = [' Sunday ',' Monday ',' Tuesday ',' Wednesday ',' Thursday ',' Friday ',' Saturday '];
var day = date.getDay();
console.log(' Today may be :' + year + ' year ' + month + ' month ' + dates + ' Japan ' + arr[day])
// If you want to add a space , Add a space after the string ( Such as :' Japan ' become ' Japan ' That's all right. )
版权声明
本文为[Courtesy.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221913415314.html
边栏推荐
- Is it safe to open futures account on mobile phone? Do you need the assistance of offline account manager?
- What kind of headphones do you wear for sports? The best equipment for running and listening to music
- Podcasts about the universe
- 重保战场的“排头兵”,“互联网宙斯盾”如何为城市高效布防?
- Advanced IPC - DBUS details
- 解决金仓数据库KingbaseES使用--force-rewind强制拉起备机时,时间线不吻合的问题
- 396. Rotation function (mathematical law + iterative method)
- Write a gateway service, understand more thoroughly!
- 微服务架构从0到1,搭建全过程记录,手把手教学,连载中...
- Recommendation of 5 papers on the application of reinforcement learning in the financial field
猜你喜欢

Why puddingswap may be a strong dark horse in the field of gamefi?

IAP之boot实现

Operation and maintenance (33) centos7 6 deploy kubernetes cluster through kubedm

New generation agent weapon - traefik

隔壁的wifi,我秒破

第二章 数组

金仓数据库KingbaseES的连接方法

Write a gateway service, understand more thoroughly!

Don't say, "I don't like development, so I choose testing."

MarkDown 学习
随机推荐
<山东大学项目实训>辐射预计算渲染及后处理降噪系统研究(一)
Cannot proceed because system tables used by Event Scheduler were found damaged
The difference between null and "" in kingbases database
Go realizes Luhn verification of bank card
Which futures company is safer to open a domestic futures account?
Filebeat
CVPR 2022: is smile recognition also sexist? Zhejiang University and Wuhan University jointly set up a fairness improvement framework
New generation agent weapon - traefik
Time format of go language
Which brand of sports headphones is better and recommended for easy-to-use sports headphones
Is it safe to open futures account on mobile phone? Do you need the assistance of offline account manager?
Introduction notes to PHP zero Foundation (11): String
calico官网网络拓扑实现:基于eNSP与VMVare
Problems that must be avoided in the process of top survey technology sorting and transformation
Redis cluster 6.2.6
STM32使用USB虚拟串口+YMODEM实现IAP升级
Don't say, "I don't like development, so I choose testing."
金仓数据库KingbaseES服务启动方法
金仓数据库KingbaseES之null和“ ”的区别
期货开户在手机上办理安全吗?需要线下客户经理协助办理吗?