What is the most precised DateTime I can use in NET 3.5?

Posted on 2013-01-21
Last Modified: 2013-01-22
What is actally precision of NET 3.5 DateTime variable ? It is 16 miliseconds? Do I have a option to replace it with some other type? Maybe with DateTimeOffset – is it has better precision?

 My situation is that I have a WinForm C# 2008 Net 3.5 project which work with Start Date and then add between 100 and 500 time durations in miliseconds /video files duration/ . I understand that best is to keep the start date in DateTime varibale and to get current date   with code
            dtCurr = dtStart.AddMilliseconds(lItemRealDurMS);

This almost will solve the problem, as I’ll get inaccuracy with only 1 calculcation, not with all 100-500 calculations. Is that correct? Anyway, I’m interesting of the most precise DateTime I can use in NET 3.5
Question by:dvplayltd
  • 3
  • 2
LVL 53

Accepted Solution

Dhaest earned 500 total points
ID: 38800246
LVL 80

Expert Comment

by:David Johnson, CD, MVP
ID: 38800939
With video files why are you not counting the frames and dividing by the fps? You can't get any more precise with a video than an individual frame

Author Comment

ID: 38801684
TO  Dhaest

Well, I find this articles before you send me. Anyway, DateTimeOffset is more precise than DateTime , or it is the same?

To ve3ofa
Well, for my project - workign with a playlist with 24 hours duration few seconds in a day are acceptable solution. Anyway, more accurance is not possible for ordinary PC - most PC timer move between 1 and 5 seconds for a day .
And I already have other system which works with miliseconds, not with frame count.
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

LVL 80

Expert Comment

by:David Johnson, CD, MVP
ID: 38801798
Video measurement is still more precise..  if the file is 2300 frames @ 23.97 fps the play length is 95.954 seconds depending upon the # of video's, involved plus the queuing speed a 24 hour playlist may be +/- a few minutes.

100 and 500 time durations in miliseconds /video files duration (this is what confused me)

Author Comment

ID: 38801981
To ve3ofa

100 and 500 time durations in miliseconds  - i mean that I loop via all file's duration and show the current time every file start .

Author Closing Comment

ID: 38805748

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change to file doesn't show up 16 57
Retrieve Active Directory Groups a User belongs to in VB.NET 3 20
JQuery Detecting page post back 6 13
IDE for Python 5 27
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question