CultureInfo and South African dates

M

Mark Finkel

Using the CultureInfo and setting it to en-ZA (South
Africa) dates are formatted yyyy/mm/dd. But the actual
usage in South Africa is dd/mm/yyyy.

I can get the proper date format by using another country
(e.g UK), but that returns the wrong currency.

Does anyone know how to get correct dates and currency for
South Africa?
 
Y

Yan-Hong Huang[MSFT]

Hello Mark,

Thanks for posting in the group.

Based on my experience, the format of one cultureinfo is determined by the
setting in the control panel. So we could open Control panel->Regional
Setting and then change the format setting to English(South Africa). We
could see that the short date format is yyyy/mm/dd.

I suggest you use the "customize" button to change the setting of it and
then test it on your side.

Does that answer your question?

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Mark Finkel" <[email protected]>
!Sender: "Mark Finkel" <[email protected]>
!Subject: CultureInfo and South African dates
!Date: Tue, 23 Sep 2003 07:34:39 -0700
!Lines: 10
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcOB39GVGGNKIMqxRIu/zVgcixqdPw==
!Newsgroups: microsoft.public.dotnet.framework
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework:54451
!NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!Using the CultureInfo and setting it to en-ZA (South
!Africa) dates are formatted yyyy/mm/dd. But the actual
!usage in South Africa is dd/mm/yyyy.
!
!I can get the proper date format by using another country
!(e.g UK), but that returns the wrong currency.
!
!Does anyone know how to get correct dates and currency for
!South Africa?
!
!
 
M

Mark Finkel

Yanhong,

I am afraid it confirms that MS has the wrong format for
South Africa. What is involved in having MS correct it?

Mark
 
M

Mark Finkel

Customizing the format does not help.

My asp.Net application gets the UserLanguage from Request,
then uses that to set the Culture for the thread. Since
the MS date format for South Africa is wrong, it displays
dates wrong.

Is there anyway to retrieve the customized date from the
browser and somehow have the asp.NET application use that
format?
 
Y

Yan-Hong Huang[MSFT]

Hello Mark,

Thanks for your reply.

You could contact Microsoft Prodoct Support Service for the date format of
North Africa. The link is:
http://support.microsoft.com/common/international.aspx?rdpath=fh;en-us;cntac
tms

You need to use free support incidents included in MSDN subscription to
submit a support request.

For the issue, I think you could build the logic in the aspx page. If the
request needs the specific format of date string, we could use
System.DateTime to parse string to a DateTime object first and then use its
ToString to convert the value of this instance to its equivalent string
representation.

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Mark Finkel" <[email protected]>
!Sender: "Mark Finkel" <[email protected]>
!References: <[email protected]>
<BnT3I#[email protected]>
!Subject: RE: CultureInfo and South African dates
!Date: Wed, 24 Sep 2003 04:32:37 -0700
!Lines: 77
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcOCj44iA+vQvm17QNSKbHKhsxgHYw==
!Newsgroups: microsoft.public.dotnet.framework
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework:54592
!NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!Customizing the format does not help.
!
!My asp.Net application gets the UserLanguage from Request,
!then uses that to set the Culture for the thread. Since
!the MS date format for South Africa is wrong, it displays
!dates wrong.
!
!Is there anyway to retrieve the customized date from the
!browser and somehow have the asp.NET application use that
!format?
!
!
!>-----Original Message-----
!>Hello Mark,
!>
!>Thanks for posting in the group.
!>
!>Based on my experience, the format of one cultureinfo is
!determined by the
!>setting in the control panel. So we could open Control
!panel->Regional
!>Setting and then change the format setting to English
!(South Africa). We
!>could see that the short date format is yyyy/mm/dd.
!>
!>I suggest you use the "customize" button to change the
!setting of it and
!>then test it on your side.
!>
!>Does that answer your question?
!>
!>Best regards,
!>Yanhong Huang
!>Microsoft Online Partner Support
!>
!>Get Secure! - www.microsoft.com/security
!>This posting is provided "AS IS" with no warranties, and
!confers no rights.
!>
!>--------------------
!>!Content-Class: urn:content-classes:message
!>!From: "Mark Finkel" <[email protected]>
!>!Sender: "Mark Finkel" <[email protected]>
!>!Subject: CultureInfo and South African dates
!>!Date: Tue, 23 Sep 2003 07:34:39 -0700
!>!Lines: 10
!>!Message-ID: <[email protected]>
!>!MIME-Version: 1.0
!>!Content-Type: text/plain;
!>! charset="iso-8859-1"
!>!Content-Transfer-Encoding: 7bit
!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!>!Thread-Index: AcOB39GVGGNKIMqxRIu/zVgcixqdPw==
!>!Newsgroups: microsoft.public.dotnet.framework
!>!Path: cpmsftngxa06.phx.gbl
!>!Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.framework:54451
!>!NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
!>!X-Tomcat-NG: microsoft.public.dotnet.framework
!>!
!>!Using the CultureInfo and setting it to en-ZA (South
!>!Africa) dates are formatted yyyy/mm/dd. But the actual
!>!usage in South Africa is dd/mm/yyyy.
!>!
!>!I can get the proper date format by using another
!country
!>!(e.g UK), but that returns the wrong currency.
!>!
!>!Does anyone know how to get correct dates and currency
!for
!>!South Africa?
!>!
!>!
!>
!>.
!>
!
 
M

Mark Finkel

Yanhong,

Thank you for your response. Unfortunately I do not
understand how your suggestion helps.

Does anyone know how to get the correct date format for
South Africa without specifically hard coding the format?
Using CultureInfo seems to work everywhere else.

Or does anyone know where to report this apparent bug?

Regards,
Mark
 
Y

Yan-Hong Huang[MSFT]

Hello Mark,

Thanks for the response.

You could refer to http://msdn.microsoft.com/subscriptions/faq/default.asp.
There is a question on "how to report a bug".

My suggestion here is to hard code the format as the workaround for the
program. Please let post here if you have any more concerns.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Mark Finkel" <[email protected]>
!Sender: "Mark Finkel" <[email protected]>
!References: <[email protected]>
<BnT3I#[email protected]>
<[email protected]>
<[email protected]>
!Subject: RE: CultureInfo and South African dates
!Date: Wed, 1 Oct 2003 05:10:43 -0700
!Lines: 161
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!Thread-Index: AcOIFQlpUQHxAB8bTG2YopcqWU/huw==
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Newsgroups: microsoft.public.dotnet.framework
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework:55160
!NNTP-Posting-Host: TK2MSFTNGXA06 10.40.1.53
!X-Tomcat-NG: microsoft.public.dotnet.framework
!
!Yanhong,
!
!Thank you for your response. Unfortunately I do not
!understand how your suggestion helps.
!
!Does anyone know how to get the correct date format for
!South Africa without specifically hard coding the format?
!Using CultureInfo seems to work everywhere else.
!
!Or does anyone know where to report this apparent bug?
!
!Regards,
!Mark
!
!>-----Original Message-----
!>Hello Mark,
!>
!>Thanks for your reply.
!>
!>You could contact Microsoft Prodoct Support Service for
!the date format of
!>North Africa. The link is:
!>http://support.microsoft.com/common/international.aspx?
!rdpath=fh;en-us;cntac
!>tms
!>
!>You need to use free support incidents included in MSDN
!subscription to
!>submit a support request.
!>
!>For the issue, I think you could build the logic in the
!aspx page. If the
!>request needs the specific format of date string, we
!could use
!>System.DateTime to parse string to a DateTime object
!first and then use its
!>ToString to convert the value of this instance to its
!equivalent string
!>representation.
!>
!>Hope that helps.
!>
!>Best regards,
!>Yanhong Huang
!>Microsoft Online Partner Support
!>
!>Get Secure! - www.microsoft.com/security
!>This posting is provided "AS IS" with no warranties, and
!confers no rights.
!>
!>--------------------
!>!Content-Class: urn:content-classes:message
!>!From: "Mark Finkel" <[email protected]>
!>!Sender: "Mark Finkel" <[email protected]>
!>!References: <[email protected]>
!><BnT3I#[email protected]>
!>!Subject: RE: CultureInfo and South African dates
!>!Date: Wed, 24 Sep 2003 04:32:37 -0700
!>!Lines: 77
!>!Message-ID: <[email protected]>
!>!MIME-Version: 1.0
!>!Content-Type: text/plain;
!>! charset="iso-8859-1"
!>!Content-Transfer-Encoding: 7bit
!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!>!Thread-Index: AcOCj44iA+vQvm17QNSKbHKhsxgHYw==
!>!Newsgroups: microsoft.public.dotnet.framework
!>!Path: cpmsftngxa06.phx.gbl
!>!Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.framework:54592
!>!NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
!>!X-Tomcat-NG: microsoft.public.dotnet.framework
!>!
!>!Customizing the format does not help.
!>!
!>!My asp.Net application gets the UserLanguage from
!Request,
!>!then uses that to set the Culture for the thread. Since
!>!the MS date format for South Africa is wrong, it
!displays
!>!dates wrong.
!>!
!>!Is there anyway to retrieve the customized date from the
!>!browser and somehow have the asp.NET application use
!that
!>!format?
!>!
!>!
!>!>-----Original Message-----
!>!>Hello Mark,
!>!>
!>!>Thanks for posting in the group.
!>!>
!>!>Based on my experience, the format of one cultureinfo
!is
!>!determined by the
!>!>setting in the control panel. So we could open Control
!>!panel->Regional
!>!>Setting and then change the format setting to English
!>!(South Africa). We
!>!>could see that the short date format is yyyy/mm/dd.
!>!>
!>!>I suggest you use the "customize" button to change the
!>!setting of it and
!>!>then test it on your side.
!>!>
!>!>Does that answer your question?
!>!>
!>!>Best regards,
!>!>Yanhong Huang
!>!>Microsoft Online Partner Support
!>!>
!>!>Get Secure! - www.microsoft.com/security
!>!>This posting is provided "AS IS" with no warranties,
!and
!>!confers no rights.
!>!>
!>!>--------------------
!>!>!Content-Class: urn:content-classes:message
!>!>!From: "Mark Finkel" <[email protected]>
!>!>!Sender: "Mark Finkel" <[email protected]>
!>!>!Subject: CultureInfo and South African dates
!>!>!Date: Tue, 23 Sep 2003 07:34:39 -0700
!>!>!Lines: 10
!>!>!Message-ID: <[email protected]>
!>!>!MIME-Version: 1.0
!>!>!Content-Type: text/plain;
!>!>! charset="iso-8859-1"
!>!>!Content-Transfer-Encoding: 7bit
!>!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!>!X-MimeOLE: Produced By Microsoft MimeOLE
!V5.50.4910.0300
!>!>!Thread-Index: AcOB39GVGGNKIMqxRIu/zVgcixqdPw==
!>!>!Newsgroups: microsoft.public.dotnet.framework
!>!>!Path: cpmsftngxa06.phx.gbl
!>!>!Xref: cpmsftngxa06.phx.gbl
!>!microsoft.public.dotnet.framework:54451
!>!>!NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
!>!>!X-Tomcat-NG: microsoft.public.dotnet.framework
!>!>!
!>!>!Using the CultureInfo and setting it to en-ZA (South
!>!>!Africa) dates are formatted yyyy/mm/dd. But the actual
!>!>!usage in South Africa is dd/mm/yyyy.
!>!>!
!>!>!I can get the proper date format by using another
!>!country
!>!>!(e.g UK), but that returns the wrong currency.
!>!>!
!>!>!Does anyone know how to get correct dates and currency
!>!for
!>!>!South Africa?
!>!>!
!>!>!
!>!>
!>!>.
!>!>
!>!
!>
!>.
!>
!
 
B

Bob Uva

Mark,

CultureInfo (in System.Globalization) has some constructors that take
two parameters, the second of which is a boolean flag indicating
whether or not any customizations set up via the Control Panel's
Regions & Languages applet should be allowed. So if you have changed
the date format for South African dates through the Control Panel, you
can then, in your C# code, instantiate a CultureInfo object, passing
true as the second constructor argument. This will essentially "allow"
your customization to be accepted and used in your program. This is
not so obvious from reading about CultureInfo but some experimentation
is well worthwhile!

Hope this helps,
Bob Uva
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top