473,378 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 shortDatePattern as String

shortDatePattern = a.DateTimeFormat.ShortDatePattern()

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 5319
Hi,

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

Ken
---------------
"Ellis Yu" <el******@transfield.com> wrote in message
news:%2***************@TK2MSFTNGP15.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 shortDatePattern as String

shortDatePattern = a.DateTimeFormat.ShortDatePattern()

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***@bellsouth.net> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemglobalizationdatetimeformatinfoclasssho rtdatepatterntopic.asp
Ken
---------------
"Ellis Yu" <el******@transfield.com> wrote in message
news:%2***************@TK2MSFTNGP15.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 shortDatePattern as String

shortDatePattern = a.DateTimeFormat.ShortDatePattern()

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******@transfield.com> schrieb:
Dim a as new CultureInfo("")
Dim shortDatePattern as String

shortDatePattern = a.DateTimeFormat.ShortDatePattern()

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


Try this:

\\\
Imports System.Globalization
..
..
..
MsgBox(CultureInfo.CurrentCulture.DateTimeFormat.S hortDatePattern)
///

--
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 DateTimeFormatInfo =
Globalization.CultureInfo.CurrentCulture.DateTimeF ormat

Ken

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

"Ellis Yu" <el******@transfield.com> wrote in message
news:%2****************@TK2MSFTNGP12.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***@bellsouth.net> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemglobalizationdatetimeformatinfoclasssho rtdatepatterntopic.asp
Ken
---------------
"Ellis Yu" <el******@transfield.com> wrote in message
news:%2***************@TK2MSFTNGP15.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 shortDatePattern as String

shortDatePattern = a.DateTimeFormat.ShortDatePattern()

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
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...
1
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...
4
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...
1
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...
7
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...
6
by: ABC | last post by:
Is there any function return the short date format on the regional and Language Options under control panel?
2
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...
21
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...
3
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.