Date comparison problems

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 Fangbeast.

Could someone check for me that my Date comparison is the right way to do it and it works? I think I got it right but not 100% sure that it compares correctly

;- Check to see if the current book is overdue or not

checkoverdue:

today = Date() ; Get the current system date
duedate = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_duedatebox))
returned = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_returnedonbox))
borrowed = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_borrowedonbox))

If today > duedate And returned = 0 ; greater than
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Overdue!")
ElseIf today > duedate And returned > duedate
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Fine!")
ElseIf returned < duedate
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Okay")
EndIf

Return


Fangles woz ear orright den?
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 Fang,
ParseDate have a bug. Please see
viewtopic.php?t=4693

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 Fangbeast.
Originally posted by Manolo

Hi Fang,
ParseDate have a bug. Please see
viewtopic.php?t=4693

Regards,

Manolo
Thanks manolo, that answers part of it. Other problem is my lack of logic :)

Fangles woz ear orright den?
Post Reply