File modification time: Difference between revisions

m
(Frink)
Line 604:
Frink runs on a Java Virtual Machine (JVM) and can use any of its methods. The underlying code returns the modification time as the number of milliseconds since 1970-01-01 00:00 UTC. The following converts between Frink's human-friendly time systems and the milliseconds since the epoch.
<lang frink>f = newJava["java.io.File", "FileModificationTime.frink"]
f.setLastModified[(#2022-01-01epoch 5:00 AM# -= #1970 UTC#) / ms]
f.setLastModified[(#2022-01-01 5:00 AM# - epoch) / ms]
println[f.lastModified[] ms + #1970 UTC#epoch]</lang>
{{out}}
<pre>
494

edits