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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:59:54+00:00 2026-06-08T12:59:54+00:00

Getting abit of a problem I only know how to use DateTime to display

  • 0

Getting abit of a problem I only know how to use DateTime to display my results like so:

    {

            string uri = "http://localhost:8002/Service/HireDate";
            XDocument xDoc = XDocument.Load(uri);
            var staff = xDoc.Descendants("HireDate")
                .Select(n => new
                {
                    StartDate = DateTime.Parse(n.Element("HireFromDate").Value), //this line
                    EndDate = DateTime.Parse(n.Element("HireToDate").Value), //this line
                    TotalDaysHired = n.Element("NumberOfDaysHired").Value,
                })
                .ToList();

            dataGrid9.ItemsSource = staff;

    }

However this outputs like this in my datagrid:

15/07/2012 00:00:00
27/07/2012 00:00:00

Is there a way to remove the time I just want the date?

  • 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-06-08T12:59:55+00:00Added an answer on June 8, 2026 at 12:59 pm

    So you want to show only the Date part of a DateTime as String? You could use DateTime.ToShortDateString() which is most readable:

    StartDate = DateTime.Parse(n.Element("HireFromDate").Value).ToShortDateString()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a bit of a problem with getting JBoss working across networks. As
I have a bit of a problem building my project. I'm getting the bellow
I'm getting a bit confused with my work. My Problem is, I want to
I'm having a problem getting more memory out of PHP. This is the error
I'm getting a problem with jQuery UI's toggleClass() , where if I leave the
I'm having a bit of a problem getting my custom JavaScript file to play
I'm a bit stuck on the last step of getting the solution to problem
I'm just getting to know regular expressions, but after doing quite a bit of
getting a bit confused over this problem... I have an administrative part of my
Getting a bit peeved now; I have a model and a class thats just

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.