473,698 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Get Short Date Format Pattern?

Dear All

I want to read the short date format pattern from the regional
setting. I write a code as follow:

'Diff. machine may has different country setting, so I use blank
here
Dim a as new CultureInfo("")
Dim shortDatePatter n as String

shortDatePatter n = a.DateTimeForma t.ShortDatePatt ern()

But I found that the pattern is different to my regional setting one. Anyone
know how to do? Thanks

Best Rdgs
Ellis
Nov 21 '05 #1
5 5327
Hi,

http://msdn.microsoft.com/library/de...tterntopic.asp

Ken
---------------
"Ellis Yu" <el******@trans field.com> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .
Dear All

I want to read the short date format pattern from the regional
setting. I write a code as follow:

'Diff. machine may has different country setting, so I use blank
here
Dim a as new CultureInfo("")
Dim shortDatePatter n as String

shortDatePatter n = a.DateTimeForma t.ShortDatePatt ern()

But I found that the pattern is different to my regional setting one. Anyone
know how to do? Thanks

Best Rdgs
Ellis

Nov 21 '05 #2
Ellis,
'Diff. machine may has different country setting, so I use blank
here But I found that the pattern is different to my regional setting one.
Anyone
know how to do? Thanks


You make me curious, how do you do that?

Even if I would use a device to find the location by satalite, than I did
not know the culture of the user.

Cor
Nov 21 '05 #3
Thanks Ken, maybe I didn't explain clear enough of my problem. I want to get
the short time format pattern from regional setting. Since the pattern maybe
changed by the user, it's different to the default pattern. Just like the
sample you given to me, if the culture is "en-US", then the short format
will be "M/d/yyyy" even the user had used his customized format instead. If
in that case, how can I do?
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:uy******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemglob alizationdateti meformatinfocla ssshortdatepatt erntopic.asp
Ken
---------------
"Ellis Yu" <el******@trans field.com> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .
Dear All

I want to read the short date format pattern from the regional
setting. I write a code as follow:

'Diff. machine may has different country setting, so I use blank
here
Dim a as new CultureInfo("")
Dim shortDatePatter n as String

shortDatePatter n = a.DateTimeForma t.ShortDatePatt ern()

But I found that the pattern is different to my regional setting one. Anyone know how to do? Thanks

Best Rdgs
Ellis

Nov 21 '05 #4
"Ellis Yu" <el******@trans field.com> schrieb:
Dim a as new CultureInfo("")
Dim shortDatePatter n as String

shortDatePatter n = a.DateTimeForma t.ShortDatePatt ern()

But I found that the pattern is different to my regional setting one.
Anyone
know how to do? Thanks


Try this:

\\\
Imports System.Globaliz ation
..
..
..
MsgBox(CultureI nfo.CurrentCult ure.DateTimeFor mat.ShortDatePa ttern)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
Hi,

Dim myDTFI As DateTimeFormatI nfo =
Globalization.C ultureInfo.Curr entCulture.Date TimeFormat

Ken

---------------------------

"Ellis Yu" <el******@trans field.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Thanks Ken, maybe I didn't explain clear enough of my problem. I want to get
the short time format pattern from regional setting. Since the pattern maybe
changed by the user, it's different to the default pattern. Just like the
sample you given to me, if the culture is "en-US", then the short format
will be "M/d/yyyy" even the user had used his customized format instead. If
in that case, how can I do?
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:uy******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemglob alizationdateti meformatinfocla ssshortdatepatt erntopic.asp
Ken
---------------
"Ellis Yu" <el******@trans field.com> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .
Dear All

I want to read the short date format pattern from the regional
setting. I write a code as follow:

'Diff. machine may has different country setting, so I use blank
here
Dim a as new CultureInfo("")
Dim shortDatePatter n as String

shortDatePatter n = a.DateTimeForma t.ShortDatePatt ern()

But I found that the pattern is different to my regional setting one. Anyone know how to do? Thanks

Best Rdgs
Ellis


Nov 21 '05 #6

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

Similar topics

10
8038
by: Bob Bedford | last post by:
I've two input fields in wich the user enter dates. I've put something like "enter date here (dd/mm/yyyy) but most of the user don't enter date in correct format. So I'd like to be able to get any format coming from user as I must put those dates in a MySQL database: some format: (non-US format, so day/month/year) 1/9/2004 1/09/2004 01/9/2004
1
4842
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime before Windows 2000 Service Pack 4 and has remained through to Windows XP. I am looking for a solution that doesn't involve rewriting our application (much) and that allows all our users to keep using Hebrew Regional Settings. To summarize our...
4
19809
by: Jo | last post by:
Is there anyway we can know using JavaScript the Short Date Format used in the Control Panel -> Regional and Language Settings? I know the using the combinations of following we can get the Locale Long Name format toString() toLocaleString() toLocaleDateString()
1
2510
by: kgatchell2001 | last post by:
Hi, I am a beginner working on a database to manage clients, payroll, station assignments, etc. I have created a query which calculates age based on subtracting the date of birth from the current date. This works fine and date of birth is entered as month, day, year in standard short date format (99/99/0000;;). Here is the problem, I would also like to print out a list of all clients who have a birthday in any given month. Presently,...
7
8486
by: Edward Mitchell | last post by:
I have a number of DateTimePicker controls, some set to dates, some set to a format of Time. The controls are all embedded in dialogs. I created the controls by dragging the DateTime picker from the Toolbox and then set the Format property appropriately. I have noticed that sometimes the Time format will reset spontaneously to Short Date. I looked at the .rc file and found that the usual form for a Short Date is as follows: CONTROL ...
6
2383
by: ABC | last post by:
Is there any function return the short date format on the regional and Language Options under control panel?
2
7000
by: savigliano | last post by:
hello, i am doing a date comparation and i have reallize that the data i have in my database (general date format) it is causing me problems, and because i don´t need the time data i would like to convert all the general date data into short date format, so i would like to delete the time part of the data, it is any way i can do that ???? Thank you in advance and sorry for my english carlos
21
3375
by: Darin | last post by:
I have an applicatoin that works 100% perfect when running on a machine setup for English (United States), but when I change it to Spanish (Mexico), the dates start giving me fits. THe reason is USA is mm/dd/yyyy and mexico is dd/mm/yyyy. So, with the computer set to mexico, any standard CDATE function is going to return the date in the dd/mm/yyyy setting since that is what the computer is set to. I want to be able to enter a date in...
3
2224
by: Matt Brown - identify | last post by:
Hello, I'm trying to figure out a method to look up by a range of dates, entries in a database. The format of the date in the database is "M\D \yyyy HH:MM:SS". What i need to do is take the dates that are in the database (formatted as above), isolate the date (which is in short format) and compare it to the short formatted date in a datetimepicker.
0
8683
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
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
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
8876
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...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3052
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
2007
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.