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 6170413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:01:56+00:00 2026-05-23T23:01:56+00:00

I am able to get date and time using: DateTime now = DateTime.Now; How

  • 0

I am able to get date and time using:

DateTime now = DateTime.Now;

How can I get the current date and time separately in the DateTime format itself?

I am not using the DateTime picker dialog box in ASP.NET (C#).

  • 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-23T23:01:56+00:00Added an answer on May 23, 2026 at 11:01 pm

    Well, you can get just today’s date as a DateTime using the Today property:

     DateTime today = DateTime.Today;
    

    or more generally, you can use the Date property. For example, if you wanted the UTC date you could use:

     DateTime dateTime = DateTime.UtcNow.Date;
    

    It’s not very clear whether that’s what you need or not though… if you’re just looking to print the date, you can use:

    Console.WriteLine(dateTime.ToString("d"));
    

    or use an explicit format:

    Console.WriteLine(dateTime.ToString("dd/MM/yyyy"));
    

    See more about standard and custom date/time format strings. Depending on your situation you may also want to specify the culture.

    If you want a more expressive date/time API which allows you to talk about dates separately from times, you might want to look at the Noda Time project which I started. It’s not ready for production just yet, but we’d love to hear what you’d like to do with it…

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

Sidebar

Related Questions

I'm able to get cells to format as Dates, but I've been unable to
I am not able to get my jwysiwyg and Jhtmlarea text editors to work
I am new to c# and Database linking that's why not able to get
I'd like to be able to create a datetime object with datetime.datetime.now() PyYAML. It's
Right now I'm using this command to retrieve all fields from the current day:
I'm using Entity Framework 4.1 Code First. In my entity, I have three date/time
I want to be able to get the next and previous row using SQLite.
I need to be able get a single specific attribute from an element with
Has anyone been able to get an NHibernate-based project up and running on a
Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default

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.