Date converison

  • Thread starter Thread starter bnob
  • Start date Start date
B

bnob

My regional setting is "yy-MM-dd" for the date

But for my application I have to use the format date "dd/MM/yyyy"
I convert the date to dd/MM/yyyy with this code :

m_curSel.ToString("dd/MM/yyyy")

But I have error : "Cast of the string "23-12-2004" in type Date is non
valide"

WHY ?

Another question : it's possible to use date variable independing of
the regional setting of the PocketPC
 
try this:

curSel.ToString("dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture

InvariantCulture - it is the answer for your second question.
 
Back
Top