I’m reading invoices but sometimes the date format include month names written in local language (for instance Maj instead of May. How could I then convert these dates into a valid international format without setting up a process to convert month names before going to date conversion?
i will suggest if name is not matching with standard 12 month name , create one xaml and invoke it ,which have following steps:
- open link - https://translate.google.com/?sl=auto&tl=en
- Type your Regional Month word and google will translate it to standard Month name.
- Get this standard name and proceed further.
Thank you. Yes, that could be one way of doing it. I’ll look in to that.
It would be quicker to have a lookup excel sheet which has the standard months in column 1 and the local months in column 2.
Read the range in as a DT
Filter it by the month you need
Return DT(0)(1).tostring which will give the local month name
If you know in advance what language the invoices are going to be you can just use CultureInfo
DateTime.Parse("5 maj 2019",new CultureInfo("sv-SE"))
Thank you so much! That was exactly the type of solution I was looking for.