-1

How to convert the date format culture:

(# 8/16/2013 #).ToString ("dd-MMM-yy") the result is: "16-Ago-13"

How to convert culture ("en-us")

1
  • 1
    What do you mean? If you're specifying the format string already, then what do you expect the culture to do? Commented Sep 20, 2013 at 16:51

2 Answers 2

7

Take a look at your formatting options here.

Basically, you can call:

myobject.ToString("MY_DATE_FORMAT", CultureInfo.CreateSpecificCulture("en-US"))
1
  • thanks, it worked, it corrected as follows: (#8/16/2013#).ToString("dd-MMM-yy", System.Globalization.CultureInfo.CreateSpecificCulture("en-US")) Commented Sep 20, 2013 at 17:01
0

You are probably looking for DateTime.TryParseExact Method or DateTime.ParseExact Method

Something like this:-

if DateTime.TryParseExact(FieldName, _
      "dd/MM/yyyy", CultureInfo.InvariantCulture, _
      DateTimeStyles.None, dateValue) Then

      FieldName = dateValue.ToString("MM/dd/yyyy")
  End If

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.