Date functions w/ Javascript

Avatar

Avatar

foleyb77

Avatar

foleyb77

foleyb77

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

pguerett

Avatar

pguerett

pguerett

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

foleyb77

Avatar

foleyb77

foleyb77

12-02-2009

Hi Paul,



you can email me at foleyb@stluciesheriff.com



Thanks for your help!

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

12-02-2009

Just sent it

Avatar

Avatar

Jono_Moore

Avatar

Jono_Moore

Jono_Moore

12-02-2009

Could I get those too Paul?



jono.moore@gmail.com

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

12-02-2009

Just sent it

Avatar

Avatar

Aditya_S_

Avatar

Aditya_S_

Aditya_S_

13-02-2009

I'd like a copy as well



aditya.shah@gsinc.com



thanks !

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

13-02-2009

Just sent it

Avatar

Avatar

ra_be

Avatar

ra_be

ra_be

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

pguerett

Avatar

pguerett

pguerett

04-08-2009