ILearnable .Net

December 1, 2005

Christmas calendar 1/24

Filed under: Uncategorized — andreakn @ 01:44

Today I will talk about something I’ve been stumped on a few times. It’s sooo easy, but it’s also easy to forget, so here goes:

DateTime Accurracy

A) The .Net DateTime type holds its accurracyin ticks: each tick is 100 nanoseconds.
IE. there are 10000 ticks each millisecond.

B) The Sql DateTime type only holds accurracy down to three milliseconds.

C) The .Net DateTime Type does *not* output its milliseconds in the standard ToString()

These three points work in unison to make it hard to work with datetimes in .net. One could always just use SqlDateTime, but this datatype is hopelessly useless (no functionality).
Frequently I find I wish we just stored the ticks in the database and did the conversion manually in my current project.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: