Date functions w/ Javascript

Avatar

Avatar
Level 2
foleyb77
Level 2

Likes

0 likes

Total Posts

24 posts

Correct reply

0 solutions
View profile

Avatar
Level 2
foleyb77
Level 2

Likes

0 likes

Total Posts

24 posts

Correct reply

0 solutions
View profile
foleyb77
Level 2

12-02-2009

Hello,



I am attempting to do this with javascript. So far I have this:



var today = Date();

//output = Thu Feb 12 2009 12:00:00 GMT-0500 (Eastern Standard Time)



1. How do I get today in MM/DD/YYYY format?

2. How should I compare DOB & today to get age?

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

12-02-2009

Dealinng with Dates in javascript is a pain .....there are some nice functions in FormCalc that allow you to do this and cange formats quickly.



To do date arithmentic you will have to use Date2Num (a FormCalc function) that will give you the number if days from a set point (called an epoch). If you change both values into a number, then you can subtract them and get a number of days. You can then manipulate that number to give you years or whatever you would like.



If you post your email address I can send you a couple of date arithemtic samples that will give you the general idea.

Avatar

Avatar
Level 2
foleyb77
Level 2

Likes

0 likes

Total Posts

24 posts

Correct reply

0 solutions
View profile

Avatar
Level 2
foleyb77
Level 2

Likes

0 likes

Total Posts

24 posts

Correct reply

0 solutions
View profile
foleyb77
Level 2

12-02-2009

Hi Paul,



you can email me at foleyb@stluciesheriff.com



Thanks for your help!

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

12-02-2009

Just sent it

Avatar

Avatar
Validate 10
Level 8
Jono_Moore
Level 8

Likes

111 likes

Total Posts

1,151 posts

Correct reply

144 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 8
Jono_Moore
Level 8

Likes

111 likes

Total Posts

1,151 posts

Correct reply

144 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
Jono_Moore
Level 8

12-02-2009

Could I get those too Paul?



jono.moore@gmail.com

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

12-02-2009

Just sent it

Avatar

Avatar
Validate 1
Level 4
Aditya_S_
Level 4

Like

1 like

Total Posts

315 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 4
Aditya_S_
Level 4

Like

1 like

Total Posts

315 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Aditya_S_
Level 4

13-02-2009

I'd like a copy as well



aditya.shah@gsinc.com



thanks !

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

13-02-2009

Just sent it

Avatar

Avatar
Validate 1
Level 1
ra_be
Level 1

Likes

0 likes

Total Posts

17 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
ra_be
Level 1

Likes

0 likes

Total Posts

17 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
ra_be
Level 1

03-08-2009

Dear Paul,

would you be so kind and email the file also to me.

ra_be@gmx.net

Thanks in advance.

Regards,

ra_be

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

04-08-2009