Understanding Unix vs NTFS timestamps:
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long | HUNDRED_NANOS_PER_MILLISECOND
The amount of 100-nanosecond intervals in one millisecond. |
| pack-priv static final long | WINDOWS_EPOCH_OFFSET
A file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true if the time exceeds the minimum or maximum UNIX time, false otherwise.the FileTime to evaluate, can be null. time)Tests whether a FileTime can be safely represented in the standard UNIX time. |
| public static boolean | Returns: true if the time can be represented in the standard UNIX time, false otherwise.the number of seconds (since Epoch) to evaluate. seconds)Tests whether a given number of seconds (since Epoch) can be safely represented in the standard UNIX time. |
| public static Date | Returns: the Date.the NTFS time in 100 nanosecond units. ntfsTime)
Deprecated
Use
Converts NTFS time (100 nanosecond units since 1 January 1601) to Java time.
FileTimes#ntfsTimeToDate(long).
|
| public static FileTime | Returns: the FileTime.the NTFS time in 100-nanosecond units. ntfsTime)
Deprecated
Use
Converts NTFS time (100-nanosecond units since 1 January 1601) to a FileTime.
FileTimes#ntfsTimeToFileTime(long).
|
| public static Date | |
| public static FileTime | toFileTime(final Date
the date to be converted. date)
Deprecated
Use
Converts FileTimes#toFileTime(Date).
Date to a FileTime.
|
| public static long | Returns: the NTFS time.the Date. date)
Deprecated
Use
Converts a FileTimes#toNtfsTime(Date).
Date to NTFS time.
|
| public static long | Returns: the NTFS time in 100-nanosecond units.the FileTime. fileTime)
Deprecated
Use
Converts a FileTimes#toNtfsTime(FileTime).
FileTime to NTFS time (100-nanosecond units since 1 January 1601).
|
| public static long | Returns: the NTFS time.the Java time. javaTime)Converts Java time (milliseconds since Epoch) to NTFS time. |
| public static long | Returns: the UNIX timestamp.the original FileTime. fileTime)Converts |
| public static FileTime | Returns: the truncated FileTime.the FileTime to be truncated. fileTime)Truncates a FileTime to 100-nanosecond precision. |
| public static FileTime | Returns: the corresponding FileTime.UNIX timestamp (in seconds, UTC/GMT). time)Converts standard UNIX time (in seconds, UTC/GMT) to |
| HUNDRED_NANOS_PER_MILLISECOND | back to summary |
|---|---|
| pack-priv static final long HUNDRED_NANOS_PER_MILLISECOND The amount of 100-nanosecond intervals in one millisecond. | |
| WINDOWS_EPOCH_OFFSET | back to summary |
|---|---|
| pack-priv static final long WINDOWS_EPOCH_OFFSET A file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC). This is the offset of Windows time 0 to Unix epoch in 100-nanosecond intervals. | |
| TimeUtils | back to summary |
|---|---|
| private TimeUtils() Private constructor to prevent instantiation of this utility class. | |
| isUnixTime | back to summary |
|---|---|
| public static boolean isUnixTime(final FileTime time) Tests whether a FileTime can be safely represented in the standard UNIX time. TODO ? If the FileTime is null, this method always returns true.
| |
| isUnixTime | back to summary |
|---|---|
| public static boolean isUnixTime(final long seconds) Tests whether a given number of seconds (since Epoch) can be safely represented in the standard UNIX time.
| |
| ntfsTimeToDate | back to summary |
|---|---|
| public static Date ntfsTimeToDate(final long ntfsTime)
Deprecated Converts NTFS time (100 nanosecond units since 1 January 1601) to Java time.
| |
| ntfsTimeToFileTime | back to summary |
|---|---|
| public static FileTime ntfsTimeToFileTime(final long ntfsTime)
Deprecated Converts NTFS time (100-nanosecond units since 1 January 1601) to a FileTime.
| |
| toDate | back to summary |
|---|---|
| public static Date toDate(final FileTime fileTime)
Deprecated Converts
| |
| toFileTime | back to summary |
|---|---|
| public static FileTime toFileTime(final Date date)
Deprecated Converts
| |
| toNtfsTime | back to summary |
|---|---|
| public static long toNtfsTime(final Date date)
Deprecated Converts a
| |
| toNtfsTime | back to summary |
|---|---|
| public static long toNtfsTime(final FileTime fileTime)
Deprecated Converts a
| |
| toNtfsTime | back to summary |
|---|---|
| public static long toNtfsTime(final long javaTime) Converts Java time (milliseconds since Epoch) to NTFS time.
| |
| toUnixTime | back to summary |
|---|---|
| public static long toUnixTime(final FileTime fileTime) Converts
| |
| truncateToHundredNanos | back to summary |
|---|---|
| public static FileTime truncateToHundredNanos(final FileTime fileTime) Truncates a FileTime to 100-nanosecond precision. | |
| unixTimeToFileTime | back to summary |
|---|---|
| public static FileTime unixTimeToFileTime(final long time) Converts standard UNIX time (in seconds, UTC/GMT) to
| |