Click here to Skip to main content
15,890,995 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: .Net Date Compare Pin
Luc Pattyn17-Jun-09 3:39
sitebuilderLuc Pattyn17-Jun-09 3:39 
GeneralRe: .Net Date Compare Pin
Baran M17-Jun-09 3:50
Baran M17-Jun-09 3:50 
GeneralRe: .Net Date Compare Pin
Tristan Rhodes17-Jun-09 10:40
Tristan Rhodes17-Jun-09 10:40 
GeneralRe: .Net Date Compare Pin
Luc Pattyn17-Jun-09 10:48
sitebuilderLuc Pattyn17-Jun-09 10:48 
GeneralRe: .Net Date Compare - Code Clean Up, Use an Extension Method for DateTime Pin
ProtoBytes17-Jun-09 12:23
ProtoBytes17-Jun-09 12:23 
GeneralRe: .Net Date Compare - Code Clean Up, Use an Extension Method for DateTime Pin
Tristan Rhodes17-Jun-09 22:51
Tristan Rhodes17-Jun-09 22:51 
GeneralRe: .Net Date Compare Pin
Tristan Rhodes17-Jun-09 22:53
Tristan Rhodes17-Jun-09 22:53 
AnswerRe: .Net Date Compare Pin
David Skelly17-Jun-09 22:20
David Skelly17-Jun-09 22:20 
Depending on which database you are using, you may see some loss of precision when you store a datetime (aka timestamp in some databases). SQL Server, for example, does not store datetime values to the exact millisecond. It is only accurate to approximately the nearest 3 milliseconds. So if it is important to get accurate timestamps right down to the exact millisecond, you should avoid the SQL Server datetime datatype.

SQL Server 2008 introduces a new datatype, datetime2, which is accurate to approximately 100ns to get around this problem.

Possible solutions:

- if you are using SQL Server 2008 and have ownership of the database, use datetime2 rather than datetime

- if you are not using SQL Server 2008 or you cannot change the table design and if you do not need millisecond accuracy, decide what accuracy you do need: for example, round off your timestamps to the nearest second before storing them

- if you do need millisecond accuracy, either convert the timestamp to a string format (OK for XML, not good for date functions and the conversion to and from datetime type may be slow) or store the timestamp as the number of milliseconds from the epoch (gives you the accuracy you need at a reasonable performance but not good for date functions)
GeneralRe: .Net Date Compare Pin
Tristan Rhodes17-Jun-09 22:56
Tristan Rhodes17-Jun-09 22:56 
GeneralRe: .Net Date Compare Pin
David Skelly18-Jun-09 4:42
David Skelly18-Jun-09 4:42 
AnswerRe: .Net Date Compare Pin
PIEBALDconsult18-Jun-09 6:19
mvePIEBALDconsult18-Jun-09 6:19 
GeneralRe: .Net Date Compare Pin
Luc Pattyn19-Jun-09 4:25
sitebuilderLuc Pattyn19-Jun-09 4:25 
GeneralRe: .Net Date Compare Pin
PIEBALDconsult19-Jun-09 4:55
mvePIEBALDconsult19-Jun-09 4:55 
QuestionShut Down Local Computer Using VB.NET Pin
shinoopmathew16-Jun-09 22:59
shinoopmathew16-Jun-09 22:59 
AnswerRe: Shut Down Local Computer Using VB.NET Pin
Henry Minute16-Jun-09 23:11
Henry Minute16-Jun-09 23:11 
AnswerRe: Shut Down Local Computer Using VB.NET Pin
Vasudevan Deepak Kumar17-Jun-09 1:36
Vasudevan Deepak Kumar17-Jun-09 1:36 
AnswerRe: Shut Down Local Computer Using VB.NET Pin
K030617-Jun-09 2:45
K030617-Jun-09 2:45 
AnswerRe: Shut Down Local Computer Using VB.NET Pin
krunal2521-Dec-09 18:41
krunal2521-Dec-09 18:41 
QuestionExport to excel is not working on deploying server Pin
binod kumar16-Jun-09 20:52
binod kumar16-Jun-09 20:52 
AnswerCross Post! Pin
Henry Minute16-Jun-09 23:08
Henry Minute16-Jun-09 23:08 
Questionhow to open a word document? Pin
kvalli16-Jun-09 20:30
kvalli16-Jun-09 20:30 
QuestionSimilar to mail box Pin
anandkb16-Jun-09 19:47
anandkb16-Jun-09 19:47 
AnswerRe: Similar to mail box Pin
Colin Angus Mackay17-Jun-09 14:40
Colin Angus Mackay17-Jun-09 14:40 
QuestionDatagridview Keypress Pin
neha.lad16-Jun-09 19:24
neha.lad16-Jun-09 19:24 
AnswerRe: Datagridview Keypress Pin
Henry Minute16-Jun-09 23:34
Henry Minute16-Jun-09 23:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.