Jan 13, 2020 #1 abbasaif ISP Joined Oct 8, 2018 Messages 89 Location AE Hi, I want to calculate time difference in minutes as follows: a=DATETIME() && {13/01/2020 02:38:15PM} b={13/01/2020 02:19:15PM} c=a-b The answer is 20 minutes, and the value of "c" is 1116. Please suggest. Thanks Abbassaif
Hi, I want to calculate time difference in minutes as follows: a=DATETIME() && {13/01/2020 02:38:15PM} b={13/01/2020 02:19:15PM} c=a-b The answer is 20 minutes, and the value of "c" is 1116. Please suggest. Thanks Abbassaif
Jan 13, 2020 #2 Mike Lewis Programmer Joined Jan 10, 2003 Messages 17,516 Location Scotland Simply subtract one datetime from the other. That will give you the difference in seconds. To get the difference in minutes, divide by 60. Mike __________________________________ Mike Lewis (Edinburgh, Scotland) Visual FoxPro articles, tips and downloads Upvote 0 Downvote
Simply subtract one datetime from the other. That will give you the difference in seconds. To get the difference in minutes, divide by 60. Mike __________________________________ Mike Lewis (Edinburgh, Scotland) Visual FoxPro articles, tips and downloads
Jan 13, 2020 #3 Mike Lewis Programmer Joined Jan 10, 2003 Messages 17,516 Location Scotland By the way, [tt]{13/01/2020 02:19:15PM}[/tt] is not a valid format for a datetime literal. You want this: [tt]{^2020-01-13,02:19:15}[/tt] Mike __________________________________ Mike Lewis (Edinburgh, Scotland) Visual FoxPro articles, tips and downloads Upvote 0 Downvote
By the way, [tt]{13/01/2020 02:19:15PM}[/tt] is not a valid format for a datetime literal. You want this: [tt]{^2020-01-13,02:19:15}[/tt] Mike __________________________________ Mike Lewis (Edinburgh, Scotland) Visual FoxPro articles, tips and downloads