Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Better date/time functions (for QM < 2.3.2)
#12
I'm trying to figure out a way to find just the number of days between two dates... here's my logic...
 
Code:
Copy      Help
str Today = "10/26/2022"
str Target = "12/25/2022"

int DaysUntil = Days(Target) - Days(Today)

out F"There are {DaysUntil} Christmas left"

#sub Days
function str'DateStr
;;   Date strings can be either MM/DD/YYYY or MM/DD/YY
     int NumDays
;;   Calculate the number of days since 1/1/1970
     NumDays = ??????(DateStr)
     ret NumDays

I guess I still don't quite understand how to use the DateTime functions properly... I'm sure Gintaras knows exactly how they work thou.  I've scoured over the Help and there's just not enough examples to clear it up for me I suppose.  Any help would be appreciated!


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)