Prev |  | Next

## 13.7. Date Resolution

PDFUnit is able to compare dates (creation and modification dates) as year-month-day or additionally hour-minute-second. Two constants are available to choose between these options:

    // Constants for date resolutions:

    com.pdfunit.Constants.AS_DATE
    com.pdfunit.Constants.AS_DATETIME

You can set a date resolution in the following methods:

    // Date resolution in test methods:

    .hasCreationDate().after(expectedDate, DateResolution)
    .hasCreationDate().before(expectedDate, DateResolution)
    .hasCreationDate().equalsTo(expectedDate, DateResolution)

    .hasModificationDate().after(expectedDate, DateResolution)
    .hasModificationDate().before(expectedDate, DateResolution)
    .hasModificationDate().equalsTo(expectedDate, DateResolution)

    // Internal used resolution DATE:
    .hasSignatureField(..).signedOn(signingDate)

    // Comparing two PDF documents, using DATE:
    .haveSameCreationDate()
    .haveSameModificationDate()

When comparing two PDF documents, date values are always compared using `DateResolution.DATE`.

Prev | Up | Next
13.6. Single and Double Quotation Marks inside Strings | Home | 13.8. Format Units - Points and Millimeters