Sign in

    This version of the module is deprecated: Use moonbitlang/pdflite instead

    bobzhang/pdflite/date does not have a README file

    PdfDate

    pub(all) struct PdfDate {
    year : Int
    month : Int
    day : Int
    hour : Int
    minute : Int
    second : Int
    hour_offset : Int
    minute_offset : Int
    } derive(Eq, ToJson,
    Debug
    )

    A PDF date with local time-zone offset components.

    The fields mirror PDF's D:YYYYMMDDHHmmSSOHH'mm' representation. Month and day default to 1 when omitted during parsing; time fields default to zero.

    pdf_bytes_of_date

    fn pdf_bytes_of_date(date : PdfDate) -> Bytes raise
    PdfError

    Formats a PDF date as an owned PDF byte string.

    Raises PdfError::BadDate if any field is outside the representable PDF date ranges.

    pdf_date_of_bytes

    fn pdf_date_of_bytes(bytes : Bytes) -> PdfDate raise
    PdfError

    Parses a PDF date from owned PDF bytes.

    pdf_date_of_string

    fn pdf_date_of_string(text : String) -> PdfDate raise
    PdfError

    Parses a PDF date from an ASCII string.

    Raises PdfError::BadDate for malformed or out-of-range dates.

    pdf_date_of_view

    fn pdf_date_of_view(bytes : BytesView) -> PdfDate raise
    PdfError

    Parses a PDF date from a byte view.

    Both strings with and without the D: prefix are accepted. Missing optional date fields use the PDF defaults described on PdfDate. Raises PdfError::BadDate for malformed or out-of-range dates.

    pdf_string_of_date

    fn pdf_string_of_date(date : PdfDate) -> String raise
    PdfError

    Formats a PDF date as an ASCII string in PDF date syntax.

    Raises PdfError::BadDate if any field is outside the representable PDF date ranges.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io