且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 SQL Server CE 中表示时间跨度的***方式是什么?

更新时间:2023-02-20 12:01:41

我建议使用 long 来表示 滴答.这就是 TimeSpan 使用的内部表示.这使您可以轻松地使用 Timespan.FromTicks() 重建您的对象 方法,并使用 Timespan 输出到数据库.Ticks 属性..NET中最小的时间单位是tick,等于100纳秒

I'd recommend using a long to represent the number of ticks. That's what TimeSpan uses as it's internal representation. This lets you easily reconstitute your object with the Timespan.FromTicks() method, and output to the database using the Timespan.Ticks property. The smallest unit of time in .NET is the tick, which is equal to 100 nanoseconds