know the number of day ?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Julien Morel.

Hi,
How to let to know the number of day which y' has between two date of the type 19-03-2003 ?
I do not see how to make...

Thank for your help




Forum in French
http://www.forumpurebasic.fr.st
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Originally posted by Julien Morel

How to let to know the number of day which y' has between two date of the type 19-03-2003 ?
I think you need something like this:

Code: Select all

(Date(year1, month1, day1, 0, 0, 0) - Date(year2, month2, day2, 0, 0, 0)) / (24 * 60 * 60)

--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.51, Ed3.53)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

Hi,

This is best solution:

Code: Select all

result=DayOfYear(Date(2002, 6, 1, 0, 0, 0))- DayOfYear(Date(2002, 1, 1, 0, 0, 0))+1 
Debug result
Regards,

Manolo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

OOOPPPPSSS,
Sorry,
Is best the example of tinman, because DayOfYear only work in the same year.

:)

Manolo
Post Reply