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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:45:55+00:00 2026-05-15T13:45:55+00:00

I was wondering, how do I show a 24hr clock in a WPF datagrid?

  • 0

I was wondering, how do I show a 24hr clock in a WPF datagrid? At the moment, the datagrid has set itself to 12 clock, using am & pm which is just plain confusing.

In the datagrid it has a simple column binding

…and I get the following

6/29/2010 10:46:42AM
6/29/2010 11:14:10PM

alt text http://picasaweb.google.com/lh/photo/NT6sM72khL10KZvoRPS9ww?feat=directlink

  • 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-15T13:45:56+00:00Added an answer on May 15, 2026 at 1:45 pm

    I’m not positive that I understand what you are asking, but I believe you just want to change the time format in your bound data?

    That’s fairly easy – use StringFormat. For example:

    <TextBlock x:Name="txt12Hour" Text="{Binding StringFormat={}{0:hh:mm:ss tt}}" />
    <TextBlock x:Name="txt24Hour" Text="{Binding StringFormat={}{0:HH:mm:ss}}" />
    

    txt12Hour shows something like 05:17:27 PM
    txt24Hour shows something like 17:17:27

    Use any of the same formatting rules that you’d use in a ToString() call in code. This applies not only to dates, but numbers, currencies, etc.

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

Sidebar

Related Questions

I am learning WPF and was wondering if there is a way to show
Wondering if anybody out there has any success in using the JDEdwards XMLInterop functionality.
Just wondering if it is possible to show a movie clip based menu inside
I am making a alarm app and was just wondering how do I show
I am just wondering how to show an image that indicates that the async
I am just wondering is this the way to show dialogs in MVVM? public
I am wondering how to show a windows form in a WPF application. Can
I was just wondering if it's possible to still show the built-in progress bar,
I am wondering if it's possible to just show the time reserved on the
I was wondering, without using images, how can I show a diagram in an

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.