Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Get Client Side Date & Time
WhatsApp
Ghanashyam Nayak
4y
6.8
k
0
0
25
Blog
<
Script
type
=
"text/javascript"
>
function DisplayDateTime()
{
var
DateTime
=
new
Date();
var
strYear
=
DateTime
.getYear();
var
strMonth
=
DateTime
.getMonth() +1;
var
strDay
=
DateTime
.getDate();
var
strHours
=
DateTime
.getHours();
var
strMinutes
=
DateTime
.getMinutes();
var
strSeconds
=
DateTime
.getSeconds();
var
tagDiv
=
document
.getElementById("DivTag");
tagDiv.innerText
=
strDay
+ "/" + strMonth + "/" + strYear + " " + strHours + ":" + strMinutes + ":" + strSeconds;
}
</
Script
>
<
Body
bgcolor
=#00ff00
onload
=
"DisplayDateTime();"
>
<
H3
>
DD/MM/YYYY HH:MM:SS
</
H3
>
<
H1
>
<
Div
id
=
"DivTag"
>
</
div
>
</
H1
>
</
Body
>
Get Client Side Date Time
Up Next
Validation Check for Video Duration on Client side
Ebook Download
View all
Frontend Developer Interview Questions and Answers
Read by 990 people
Download Now!
Learn
View all
Membership not found