/// <summary> /// Converts FileTime to "standard Unix time". /// </summary> public static long FileTimeToUnixTime(FileTime ftime) { return(ftime.To(TimeUnit.SECONDS)); }
/// <summary> /// Sets the last modification time of the entry. /// /// <para> When output to a ZIP file or ZIP file formatted output stream /// the last modification time set by this method will be stored into /// zip file entry's {@code date and time fields} in {@code standard /// MS-DOS date and time format}), and the extended timestamp fields /// in {@code optional extra data} in UTC time. /// /// </para> /// </summary> /// <param name="time"> /// The last modification time of the entry </param> /// <returns> This zip entry /// </returns> /// <exception cref="NullPointerException"> if the {@code time} is null /// </exception> /// <seealso cref= #getLastModifiedTime() /// @since 1.8 </seealso> public virtual ZipEntry SetLastModifiedTime(FileTime time) { this.Mtime = Objects.RequireNonNull(time, "lastModifiedTime"); this.Xdostime = javaToExtendedDosTime(time.To(TimeUnit.MILLISECONDS)); return(this); }
/// <summary> /// Converts FileTime to Windows time. /// </summary> public static long FileTimeToWinTime(FileTime ftime) { return((ftime.To(TimeUnit.MICROSECONDS) - WINDOWS_EPOCH_IN_MICROSECONDS) * 10); }