papercut19
Newcomer
- Joined
- Mar 22, 2006
- Messages
- 1
hy everyone,
i working on a site wher i have 2 calculate the days that someone has on the event.
the meaning is that i get 2 dates form the database. No problem so far. But then i have 2 substrackt the 2 dates. I got this 2 but i have 31 days in each month
so the diffrence between 03/07/2006 and 29/06/2006 gives 5 and it should be 4.
My code is : var datum1 = new Date(2006, 06, 29);
var datum2 = new Date(2006, 07, 03);
var DiffADate = Math.round((datum2 - datum1)/864e5);
i working on a site wher i have 2 calculate the days that someone has on the event.
the meaning is that i get 2 dates form the database. No problem so far. But then i have 2 substrackt the 2 dates. I got this 2 but i have 31 days in each month
so the diffrence between 03/07/2006 and 29/06/2006 gives 5 and it should be 4.
My code is : var datum1 = new Date(2006, 06, 29);
var datum2 = new Date(2006, 07, 03);
var DiffADate = Math.round((datum2 - datum1)/864e5);