File modification time: Difference between revisions

Content added Content deleted
(Frink)
Line 604: 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.
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"]
<lang frink>f = newJava["java.io.File", "FileModificationTime.frink"]
f.setLastModified[(#2022-01-01 5:00 AM# - #1970 UTC#) / ms]
epoch = #1970 UTC#
f.setLastModified[(#2022-01-01 5:00 AM# - epoch) / ms]
println[f.lastModified[] ms + #1970 UTC#]</lang>
println[f.lastModified[] ms + epoch]</lang>
{{out}}
{{out}}
<pre>
<pre>