# General Business Category > Accounting Forum >  message string was not recognized as a valid datetime. pastel

## Maijane

Good day,

Am having a problem importing CSV to Pastel Bank Managet, 

This is the message i get "message string was not recognized as a valid datetime. pastel"

What might be the problem because i have checked my date is correct.

Thank you

----------


## iv@telkomsa.net

Good day,

I have the exact same problem..... :Mad: 
Don't know what to do....

----------


## warnerjonn

Use DateTime.ParseExact.- Converts the specified string representation of a date and time to its DateTime equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly. ParseExact and TryParseExact allows to use a custom format string.

DateTime date = DateTime.ParseExact(strDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);

The IFormatProvider parameter specifies the culture to use to parse the date. Unless your string comes from the user, you should pass CultureInfo.InvariantCulture. If the string does come from the user, you should pass CultureInfo.CurrentCulture, which will use the settings that the user specified in Regional Options in Control Panel.

----------

