TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Birth Date Calculator using JavaScript
Manish Pipaliya
May 05
2015
Code
1.5
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
< div
class
=
"porson1"
> Enter Your Birth Date: - < input type =
"text"
id =
"date"
/ > < button type =
"button"
onclick =
"mydate()"
> Submit < /button>
<br / > (Date Like(1993, 08, 19)) < p id =
"aa"
style =
"visibility: hidden"
> Mile Second < /p>
<p id=
"subfull"
>
Mile Second</p > < p id =
"bb"
> Second < /p>
<p id=
"cc"
>
Minute</p > < p id =
"dd"
> Hour < /p>
<p id=
"ee"
>
Day</p > < p id =
"ff"
> Year < /p>
<p id=
"full"
style=
"visibility: hidden"
>
full</p > < script type =
"text/javascript"
>
function
mydate() {
var
d;
d = document.getElementById(
"date"
).value;
var
date =
new
Date();
document.getElementById(
"full"
).innerHTML = date.getTime();
var
dat =
new
Date(d);
document.getElementById(
"aa"
).innerHTML = +dat.getTime();
var
tot;
tot = date - dat;
document.getElementById(
"subfull"
).innerHTML =
"Your Birthday to today Mile Second is :"
+ tot;
var
text;
text = tot / 1000;
document.getElementById(
"bb"
).innerHTML =
"Your Birthday to today Second is :"
+ text;
var
min;
min = text / 60;
document.getElementById(
"cc"
).innerHTML =
"Your Birthday to today Minute is :"
+ min;
var
hour;
hour = min / 60;
document.getElementById(
"dd"
).innerHTML =
"Your Birthday to today Hour is :"
+ hour;
var
day, days;
day = hour / 24;
days = Math.floor(day);
document.getElementById(
"ee"
).innerHTML =
"Your Birthday to today Days is :"
+ days;
var
yer, yea;
yer = days / 365;
yea = Math.floor(yer);
document.getElementById(
"ff"
).innerHTML =
"Your Birthday to today Years is :"
+ yea;
} < /script>
</div >
< div
class
=
"porson2"
> Enter partner Birth Date: - < input type =
"text"
id =
"ta"
/ > < button type =
"button"
onclick =
"myd()"
> Submit < /button>
<br / > (Date Like(1993, 08, 19)) < p id =
"pa"
style =
"visibility: hidden"
> Mile Second < /p>
<p id=
"pb"
>
Mile Second</p > < p id =
"pc"
> Second < /p>
<p id=
"pd"
>
Minute</p > < p id =
"pe"
> Hour < /p>
<p id=
"pf"
>
Day</p > < p id =
"pg"
> Year < /p>
<p id=
"ph"
style=
"visibility: hidden"
>
full</p > < script type =
"text/javascript"
>
function
myd() {
var
d1;
d1 = document.getElementById(
"ta"
).value;
var
date1 =
new
Date();
document.getElementById(
"ph"
).innerHTML = date1.getTime();
var
dat1 =
new
Date(d1);
document.getElementById(
"pa"
).innerHTML = +dat1.getTime();
var
tot1;
tot1 = date1 - dat1;
document.getElementById(
"pb"
).innerHTML =
"Your Birthday to today Mile Second is :"
+ tot1;
var
text1;
text1 = tot1 / 1000;
document.getElementById(
"pc"
).innerHTML =
"Your Birthday to today Second is :"
+ text1;
var
min1;
min1 = text1 / 60;
document.getElementById(
"pd"
).innerHTML =
"Your Birthday to today Minute is :"
+ min1;
var
hour1;
hour1 = min1 / 60;
document.getElementById(
"pe"
).innerHTML =
"Your Birthday to today Hour is :"
+ hour1;
var
day1, days1;
day1 = hour1 / 24;
days1 = Math.floor(day1)
document.getElementById(
"pf"
).innerHTML =
"Your Birthday to today Days is :"
+ days1;
var
yer1, yea1;
yer1 = days1 / 365;
yea1 = Math.floor(yer1);
document.getElementById(
"pg"
).innerHTML =
"Your Birthday to today Years is :"
+ yea1;
} < /script>
</div >
birth date calculator
JavaScript Calculator