Top Description Fields Constructors Methods
org.apache.poi.hpsf

public Class Filetime

extends Object
Class Inheritance
Annotations
@Internal
Static Imports
org.apache.poi.util.LittleEndianConsts.LONG_SIZE

The Windows FILETIME structure holds a date and time associated with a file. The structure identifies a 64-bit integer specifying the number of 100-nanosecond intervals which have passed since January 1, 1601, Coordinated Universal Time (UTC).

Field Summary

Modifier and TypeField and Description
private static final BigInteger
EPOCH_DIFF

The difference between the Windows epoch (1601-01-01 00:00:00) and the Unix epoch (1970-01-01 00:00:00) in milliseconds.

private long
private static final BigInteger
NANO_100

Factor between filetime long and date milliseconds

Constructor Summary

AccessConstructor and Description
public
public
Filetime(Date date)

Method Summary

Modifier and TypeMethod and Description
public static long

Returns:

The filetime
dateToFileTime
(final Date
The date to be converted
date
)

Converts a Date into a filetime.

public static Date

Returns:

The Windows FILETIME as a Date.
filetimeToDate
(final long
The filetime to convert.
filetime
)

Converts a Windows FILETIME (in UTC) into a Date (in UTC).

public Date
public static boolean

Returns:

true if the date is undefined
isUndefined
(Date
the date
date
)

Return true if the date is undefined

public void
public byte[]
private static BigInteger
twoComplement(final long val)

public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EPOCH_DIFFback to summary
private static final BigInteger EPOCH_DIFF

The difference between the Windows epoch (1601-01-01 00:00:00) and the Unix epoch (1970-01-01 00:00:00) in milliseconds.

fileTimeback to summary
private long fileTime
NANO_100back to summary
private static final BigInteger NANO_100

Factor between filetime long and date milliseconds

Constructor Detail

Filetimeback to summary
public Filetime()
Filetimeback to summary
public Filetime(Date date)

Method Detail

dateToFileTimeback to summary
public static long dateToFileTime(final Date date)

Converts a Date into a filetime.

Parameters
date:Date

The date to be converted

Returns:long

The filetime

See Also
filetimeToDate(long)
filetimeToDateback to summary
public static Date filetimeToDate(final long filetime)

Converts a Windows FILETIME (in UTC) into a Date (in UTC).

Parameters
filetime:long

The filetime to convert.

Returns:Date

The Windows FILETIME as a Date.

getJavaValueback to summary
public Date getJavaValue()
isUndefinedback to summary
public static boolean isUndefined(Date date)

Return true if the date is undefined

Parameters
date:Date

the date

Returns:boolean

true if the date is undefined

readback to summary
public void read(LittleEndianByteArrayInputStream lei)
toByteArrayback to summary
public byte[] toByteArray()
twoComplementback to summary
private static BigInteger twoComplement(final long val)
writeback to summary
public int write(OutputStream out) throws IOException