summaryrefslogtreecommitdiffstats
path: root/date.pyx
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@serenitascapital.com>2016-06-30 10:37:11 -0400
committerGuillaume Horel <guillaume.horel@serenitascapital.com>2016-06-30 10:39:46 -0400
commit6b0a14370d244d4ff3b6277c49a23b04b8957678 (patch)
tree53cf3a2a557e7d746c2d5a6e89c241c631e4dcad /date.pyx
parent41fad2c2e88ef770b22c62c916cf6c5c68268836 (diff)
downloadpyisda-6b0a14370d244d4ff3b6277c49a23b04b8957678.tar.gz
fix some maturities, still not matching :(
Diffstat (limited to 'date.pyx')
-rw-r--r--date.pyx5
1 files changed, 5 insertions, 0 deletions
diff --git a/date.pyx b/date.pyx
index 2852f1b..8df0df8 100644
--- a/date.pyx
+++ b/date.pyx
@@ -4,3 +4,8 @@ from date cimport JpmcdsDate
cdef TDate pydate_to_TDate(d):
assert isinstance(d, datetime.date)
return JpmcdsDate(d.year, d.month, d.day)
+
+cpdef object TDate_to_pydate(TDate d):
+ cdef TMonthDayYear date
+ if JpmcdsDateToMDY(d, &date) == 0:
+ return datetime.date(date.year, date.month, date.day)