473,832 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there any function return the short date format on the regional and Language Options under control panel?

ABC
Is there any function return the short date format on the regional and
Language Options under control panel?
Apr 12 '06 #1
6 2390
Do you mean the formatter as in "h:mm:ss tt:

Iv'e done that before (can't remember when or even if iw was c#).

But I'm prettuy sure I just read it from a registry key...

-dm

Apr 12 '06 #2
Quickly looking at my XP box I find.

HKEY_CURRENT_US ER\Control Panel\Internati onal\STimeForma t

Apr 12 '06 #3
ABC
under .NET framework, how to obtain this key value?
<th*********@gm ail.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
Quickly looking at my XP box I find.

HKEY_CURRENT_US ER\Control Panel\Internati onal\STimeForma t

Apr 12 '06 #4
Use the class "RegistryKe y".

MSDN doco will explain it well enough for you.

-dm

Apr 12 '06 #5
If your obtaining this string for the purpose of creating a controll
panel substiture this is all fine.

However if what you realy mean to ask is "how do I correctly print
DateTime as short date using regional settings" then this aproach is
not for you.

Instead look up datetime format strings and the DateTime.ToStri ng
function in msdn.

-dm

Apr 12 '06 #6
ABC
I need obtain the short date format string to display on my web site for
indicate users what date format to use. Also, the short date format apply
on all date text input and output.

<th*********@gm ail.com> wrote in message
news:11******** **************@ v46g2000cwv.goo glegroups.com.. .
If your obtaining this string for the purpose of creating a controll
panel substiture this is all fine.

However if what you realy mean to ask is "how do I correctly print
DateTime as short date using regional settings" then this aproach is
not for you.

Instead look up datetime format strings and the DateTime.ToStri ng
function in msdn.

-dm

Apr 12 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4969
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
8
2253
by: Ishbel Kargar | last post by:
Since upgrading from old laptop (Windows 98) to new laptop (Windows XP), my mail-merge letters are doing strange things with date formats. For instance, my reminder letter for lapsed subs carries the 'expiry' date as a merge field from the database, and this previously was shown as dd/mm/yy (UK format). Now it persists in showing as mm/dd/yy. I've gone to the Windows Control Panel and made sure that my Regional settings show UK format,...
6
5044
by: Stewart Allen | last post by:
Hi, I'm having trouble with the DMin function in finding the next date in the table that is greater than or is the same the date entered; The dates in the table's field are 04/18/02 06/16/02 09/10/02 12/15/02
5
3842
by: Ishaan | last post by:
Hi, Is there any way to pick the data format from operating system settings using C#? I am doing an ASP.Net Application. -- Software engineer Petroleum Development Oman
1
1271
by: ABC | last post by:
Is there any function return the short date format on the regional and Language Options under control panel?
1
1597
by: paulquinlan100 | last post by:
Hi I have a date field which when i enter the date in some places, works fine, however, when trying to enter dates on certain rows i get the message: "The value you entered isn't valid for this field. For example you have entered text in a numeric field" etc. It seems to be fairly random which rows are ok and which arent. The
0
1838
by: SharmaPunit | last post by:
I want to display a date in m/d/yy format. I have written the following lines of code and it is running perfectly till the date format in the regional settings of my computer is set to mm/dd/yyyy or any other which have '/' as a seperator. As soon as I change my date format in the control panel->regional settings-> date to yyyy-mm-dd i.e. with a seperator '-', the following lines of code returns date with '-' as a seperator(m-d-yyyy). I want...
5
2939
by: snow | last post by:
Hi All, ToOADate can change a date value to a double value, but if I change the Regional and Lauguage setting in control panel, for example, change English(US) to English(Australia) , the same date time will get different double values from function ToOADate. How to always get the same double value no matter what setting is in control panel? Thanks for the help!
7
1505
by: pb | last post by:
Hi, I am updating a database based and adding the time the entry was added with the query below... strQuery = "INSERT INTO Visits ( EmailAddress, , TimeCreated ) values ('" & emailaddress & "','" & password & "','" & Now() & "')" The TimeCreated field is specified as a date field.
1
12253
by: Doug | last post by:
Hi, I created a short date field. The format is dd/mm/yyyy when displayed. The input mask is set to 99/99/00;0 (default, I didn't type anything). If I edit an existing date, say change 12/14/2007 to 12/15/2007, I get an error "the value you entered isn't appropriate for the input mask." I have to delete the "20" in the year to get it accepted, and then it puts the 20 right back. (I have the field set to required.) I changed 99/99/00;0...
0
9794
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10780
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5788
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4420
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3077
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.