| mikezilla.com

Difference between 2 Date and Time fields

[ie, gecko]

This example shows how to determine if one date/time is greater than another if they are entered in text fields and drop downs. The text fields are converted to date objects and the difference between them is calculated in minutes.

Just for demonstration purposes the date field id free text and is expecting a UK date format of dd/mm/yyyy. As the Javascript date object expects a date in mm/dd/yyyy the date must be converted before the cobject can be created.

Start Date: (dd/mm/yyyy)
Start Time: :

End Date: (dd/mm/yyyy)
End Time: :

© Mike Golding 2003 [21/05/03]