Re: Compare times: file modification time

2017-08-02 Thread Martin Tschierschke via Digitalmars-d-learn

On Wednesday, 2 August 2017 at 13:32:46 UTC, Adam D. Ruppe wrote:
On Wednesday, 2 August 2017 at 13:25:25 UTC, Martin 
Tschierschke wrote:
I get a SysTime, how to check if it is older than an interval 
(1 day)?

D/Phobos idiomatically?


   if(Clock.currTime - timeLastModified("aa.d") > 1.days) {
  // older
   }

Thank you Adam. So simple!



Re: Compare times: file modification time

2017-08-02 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 2 August 2017 at 13:25:25 UTC, Martin Tschierschke 
wrote:
I get a SysTime, how to check if it is older than an interval 
(1 day)?

D/Phobos idiomatically?


   if(Clock.currTime - timeLastModified("aa.d") > 1.days) {
  // older
   }



Compare times: file modification time

2017-08-02 Thread Martin Tschierschke via Digitalmars-d-learn

With

import std.file:timeLastModified;
auto time = timeLastModified(source);

I get a SysTime, how to check if it is older than an interval (1 
day)?

D/Phobos idiomatically?

(Currently I am using 
(Clock.currTime().toUnixTime-time.toUnixTime)< 60*60*24)).


Regards mt.