Skip to content

utils

Core utility functions for date conversions and related helpers.

Functions:

pydate_to_qldate

pydate_to_qldate(date: date) -> Date

Convert a Python date object to a QuantLib date object.

Parameters:

  • date

    (date) –

    The Python date object to be converted.

Returns:

  • Date

    The corresponding QuantLib date object.

qldate_to_pydate

qldate_to_pydate(date: Date) -> date

Convert a QuantLib date to a Python date.

Parameters:

  • date

    (Date) –

    The QuantLib date to be converted.

Returns:

  • date

    The equivalent Python date.

qldate_to_string

qldate_to_string(date: Date) -> str

Convert a QuantLib date to a string.

Parameters:

  • date

    (Date) –

    The QuantLib date to be converted.

Returns:

  • str

    A string in YYYY/MM/DD format.