How does the quantlib set up hour time, say in the example below:

ql.Date(20, 1, 2023), US calendar,

what is the time, 12 AM US time? local machine time?

say I would like to set up a NY 4 pm time, is it possible?


1 Answer 1


By default, an instance of Date is just a date and doesn't have time information.

It's possible to compile QuantLib so that it also has a time (see here), but this is not enabled by default since it slows down the library. If you do choose that configuration, you'll need to recompile both QuantLib and its Python wrappers yourself.

Also, the non-default configuration allows Date instances to have a time, but not a timezone. You'll be able to say ql.Date(20, 1, 2023, 16, 0, 0) to specify 4PM, but not that it's NY time. It leaves it up to you to convert and use consistent times.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.