By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,239 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,239 IT Pros & Developers. It's quick & easy.

How to Get Short Date Format Pattern?

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.