The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
date and time, get newest (latest) from two dates
#1
I read in the following topic-link about using the '>' operator to get the newest file.
getfile newest

If I try it, it sometimes gives me the desired result and sometimes not.
(it's a bit strange, I can not explain why).

Does the below approach which I took, relates with the explanation in the link above?

Macro Macro4
Code:
Copy      Help
Dir dir_a
if dir_a.dir(source_pth 1)
,DateTime a=dir_a.TimeModified

Dir dir_b
if dir_b.dir(full_target_pth 1)
,DateTime b=dir_b.TimeCreated

if(dir(full_target_pth 1)&&dir(source_pth 1))
,if(a>b)
,,backup_or_restore="backup"
,if(a<b)
,,backup_or_restore="restore"


If the above approach is correct, then can I assume (?) that everything on the LEFT side of the > operator is newest (newest date/time).
So from the above example a would be the newest date in this situation ? :
Code:
Copy      Help
if(a>b)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)