© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
Darker

Mongo DBDriver, how to serialise DateTimeOffset

Hi guys,

I just learned that mongo stores datetime offsets as an array, and that I can use BsonRepresentation(BsonType.String)] to save them as string instead.

Is there a way that I can specify the a custom bson representation fluently, instead of having to decorate each DatetTimeOffset property in my classes?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ How to sum datetimeoffset and timespan?
C#CC# / help
3y ago
✅ Converting string to DateTimeOffset
C#CC# / help
2y ago
DateTimeOffset vs DateTime
C#CC# / help
3y ago
DateTimeOffset, DateTime, unixtime, localtime, utctime
C#CC# / help
3y ago