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

  • Home
  • SEARCH
  • 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 1108535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:05:56+00:00 2026-05-17T02:05:56+00:00

I noticed today that if you declare a nullable DateTime object you don’t get

  • 0

I noticed today that if you declare a nullable DateTime object you don’t get the same set of functions as you do when you have a standard DateTime object.

For example:

DateTime? nullableDT = DateTime.Now;
DateTime regularDT = DateTime.Now;

in the code above nullableDT cannot use any of the following functions:

ToFileTime
ToFileTimeUtc
ToLocalTime
ToLongDateString
ToLongTimeString
ToOADate
ToShortDateString
ToShortTimeString
ToString(IFormatProvider)
ToString(String)
ToString(String, IFormatProvider)
ToUniversalTime

This is the short list, there are many more methods not available.

Why is .NET behaving like this? I worked around it by throwing a Convert.ToDateTime() around my nullable date but that seems krufty… Is there a better way?

  • 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-17T02:05:57+00:00Added an answer on May 17, 2026 at 2:05 am

    That’s because you need to call Nullable<T>.Value to get the actual DateTime value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed today that i don't have an HTML editor in my list. How
Today I have noticed that the order in which the $lt and $gt operators
I encountered an interesting thing today that I have never noticed before. It appears
I have a wcf webHttp endpoint and noticed today that when called httpGet with
Just today I noticed a strange behavior in an object model that was previously
Today my question is about UITableViewController-s In particular I have noticed that the datasource
I noticed today that haml & sass have split in their upgrade to 3.1.
I have a program that gathers information from referring urls. Today i noticed that
I just noticed today that I have got lots of spam links in my
I noticed today that I can't use * to pass width or precision arguments

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.