0

Need help JavaScript

hello guys , how can i get in which century the inserted date birth in input element, which syntax of javascript should I use ?

9th Jun 2020, 8:17 PM
Sabah RK
Sabah RK - avatar
6 Answers
+ 1
Use getFullYear method of Date object. https://code.sololearn.com/WBAdQciZEPxG/?ref=app
10th Jun 2020, 12:57 AM
CalviŐ˛
CalviŐ˛ - avatar
0
for exam! when you insert 010589 date birth so i can get the century of birth by year 1700 ot 1900 or 2000 like that
9th Jun 2020, 9:12 PM
Sabah RK
Sabah RK - avatar
0
Try getFullYear()
9th Jun 2020, 9:15 PM
ARNAB BISWAS
ARNAB BISWAS - avatar
0
when i have input in html then inserted date ! how to get the year ?
9th Jun 2020, 9:19 PM
Sabah RK
Sabah RK - avatar
0
var year = document.getElementById('IdOfThatField').value;
9th Jun 2020, 9:21 PM
ARNAB BISWAS
ARNAB BISWAS - avatar
- 1
Your question is unclear.. what do you mean by centry of your date of birth?
9th Jun 2020, 9:10 PM
ARNAB BISWAS
ARNAB BISWAS - avatar