2night / mondo

D library for MongoDb (over mongo-c-library)
MIT License
22 stars 8 forks source link

DateTime field #9

Closed zafer06 closed 7 years ago

zafer06 commented 7 years ago

Hello. Great work. Thank you for this. How can I write and read datetime field with mondo.

trikko commented 7 years ago

Sorry I didn't notice this. I fixed a related issue. You can simply read it using

yourobj["field"].as!BsonDateTime
yourobj["field"].get!BsonDateTime
yourobj["field"].to!BsonDateTime

(or SysTime. BsonDateTime is just an alias)