convert an english format to any other format

M

mhulme

Hi, first post.

I've had no success converting a date in en-US format to another
language format base on a parameter to my function. I think i'm
missing something stupid --


pseudocode:

function doDate (byval strLocale as string, byval ENDate as string)

dim strReturn as string
Dim myDTFI As DateTimeFormatInfo = New CultureInfo(strLocale,
True).DateTimeFormat

strReturn = DateTime.ParseExact(ENDate, myDTFI.ShortDatePattern,
CultureInfo.GetCultureInfo(New CultureInfo(strLocale, True).LCID))

return strReturn
end function

I want doDate("de-DE", "10/13/2006") to return "13.10.2006" for
instance. ( I have 20+ other languages to handle too)

Thanks,
MH
 

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