I'm accessing Paradox file by binary reading.

But I have a question. I don't know what conversion should I to do from Time in Paradox Database:

  • TimeSpan
  • DateTime
  • Or I should to convert to string
有帮助吗?

解决方案

The DateTime will always has the date part.

The TimeSpan is most likely what you need. It can keep the hours, minutes... without date.

EDIT: reaction to incorrect comment

Suggested mapping of the Time to DateTime is simply incorrect abstraction. Theny your C# property contains a date 01/01/0001 which is wrong (not intended) and also most be handled all the time you access such a property.

While TimeSpan, can show exactly what we want: the time ellpased from the middnight. So if we do map time from DB type, this will provide us with out of the box functionality: can be loaded as time, can be stored as a time.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top