digitalmars.D.learn - Convert SysTime to TickDuration?
- Andrej Mitrovic (18/18) Nov 22 2011 I need the number of ticks for a file's modification date.
I need the number of ticks for a file's modification date.
module test;
import std.datetime;
import std.file;
import std.stdio;
void main()
{
auto res1 = TickDuration(timeLastModified("test.d")); // NG
auto res2 = TickDuration.from!"hnsecs"(timeLastModified("test.d").stdTime);
writeln(res2);
}
First one doesn't work, and it's really a pain having to find all
these from/to/convert methods just to convert one value to another.
The second one returns a negative number, but I can't tell whether
this is right. Isn't the tick count supposed to be positive?
Tango had this method:
Path.modified(m.path).ticks;
Very simple there.
Nov 22 2011








Andrej Mitrovic <andrej.mitrovich gmail.com>