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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:49:09+00:00 2026-06-04T15:49:09+00:00

According to this article I know, that DateTimePicker control does not reflect CurrentUICulture So,

  • 0

According to this article I know, that DateTimePicker control does not reflect CurrentUICulture
So, how can I get the real culture it’s using? I need that to get the string value of DateTimePicker in multi-language application, but in exactly the same format as user sees on form (and no, I can’t set “hardcode” custom formatting).

Example:
When I’m working on Windows with my native Polish settings, then for LongTime it’s: HH:mm:ss and time in DateTimePicker is displayed like: 09:26:50

Now, when I want to select different language in my application and change culture settings to US in form’s constructor:

...
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-US");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;

InitializeComponent();
....

then

MessageBox.Show(System.Globalization.DateTimeFormatInfo.CurrentInfo.LongTimePattern);

shows, that new time format is: h:mm:ss tt, yet DateTimePicker still is displaying: 09:26:50

When I try to get the time string like:

dateTimePicker1.Value.ToLongTimeString()

or

dateTimePicker1.Value.ToString(System.Globalization.DateTimeFormatInfo.CurrentInfo.LongTimePattern)

then time is displayed like: 9:26:50 AM

So my question is – how can I either know, that DateTimePicker is still using system’s CultureInfo(“pl-PL”) or that it’s display format is: HH:mm:ss ?

  • 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-04T15:49:15+00:00Added an answer on June 4, 2026 at 3:49 pm

    DateTimePicker is a native Windows control. It uses the time format as configured in the Control Panel + Region and Language applet. Which looks like this on my machine (I live in the USA):

    enter image description here

    So one way you can find out what format it uses is by storing the Thread.CurrentCulture value before you change it.

    Do note that changing the culture of the UI thread is a pretty dangerous thing to do. The problem is that any other thread in your program, especially little thread-pool and I/O completion threads, still run with the machine’s default culture, as configured in the Administrative tab in the above screenshot. That can cause subtle bugs that are hard to find. Like a SortedList created on the UI thread that suddenly isn’t sorted anymore in the worker thread. .NET 4.5 will provide a fix for this problem with the added CultureInfo.DefaultThreadCurrentCulture and DefaultThreadCurrentUICulture properties.

    Rest assured that few users of your program will actually wish to run it in a language that doesn’t match their machine setting and mother tongue. Providing a language change option in your UI is a demo feature, it doesn’t actually get used.

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

Sidebar

Related Questions

I know, according to this article that I should Sign the message, then Encrypt
According to this article , it's possible to get multiline XML comments -- instead
According to this article: http://subsonicproject.com/docs/3.0_Migrations Bottom line: if you're a developer that is concerned
According to this article about writing shell extensions in .Net, inheriting the shell interfaces
I am doing a tutorial according to this article . This is basic Hello
I've got a PHP-fpm setup on nginx setup according to this article: http://interfacelab.com/nginx-php-fpm-apc-awesome/ PHP
I didnt find anything according this issue. Can jaas be used to secure my
according to this code i dont understand about NSClassFromString how did i know viewControllerName
I was reading this article today on two different regular expression algorithms. According to
According to this http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html article, I defnitely should. Quote Gentle, yet insistent executive summary:

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.