Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7076817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:20:41+00:00 2026-05-28T06:20:41+00:00

I have a date format of yyyy-mm-dd hh:mm:ss.nnn in my sql datasource when i

  • 0

I have a date format of yyyy-mm-dd hh:mm:ss.nnn in my sql datasource

when i look at the data in SSMS it looks fine

but when i get the return value in my C# it looks like this:

40927,7895138889

but the value in the source is:

2011-12-29 21:52:47.427

I haven’t seen this before, can anyone advise on what might be happening?

thanks.

edit: i am returning this value from sql server 2005 to my asp.net mvc 1.0 nerddinner tutorial site

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:20:41+00:00Added an answer on May 28, 2026 at 6:20 am

    Dates are stored as numbers in SQL, x days past some starting date (I think in 1753). Somehow, it looks like you are storing the returned date value in a float field. Try adding your 40927 to 1/1/1753 (40,927 days past January 1, 1753) and see if you get the right value

    Try this SQL command

    select cast( cast('1/1/1900' as dateTime) as float)
    

    it will return 0, indicating Jan 1, 1900 is the first date. I suspect the field type is smalldatetime which stores dates and times of day with less precision than datetime datatype. Valid date range for this data type is from January 1, 1900 through June 6, 2079.

    The number represents number of day past Jan 1, 1900. The fractional part is the time portion. Try this:

    select  cast(40927.7895138889 as dateTime)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used date(mm/dd/yyyy) format to insert get date in PHP but when i
I have this date format: <entry key=buildDate type=date value=now pattern=MM-dd-yyyy HH:mm:ss/> But ant gives
I have a date being passed to my script in the format as yyyy-mm-dd.
I have a date in String format, mm/dd/yyyy I want to convert this to
I have date in sting object in following format. dd/mm/yyyy I want to change
I have the need to display a date in this format: dd/mm/yyyy. This is
I am have a string named begin_date which contain date in the format dd.mm.yyyy
I have table with one of the columns as date in 'YYYY-MM-DD' format. Can
I have a date in this format: dd.mm.yyyy When I instantiate a JavaScript date
I have date in dd/mm/yyyy format. How can I store it in a database,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.