Working with Date (dd.MM.yyyy) format

Hi all,

I have an Excel datatable as input for the Bulk Queue items activity.
The date format in my Excel datatable = dd=MM-yyyy.

Then I assign the date as string to my process, as below.

image

How can I convert my string date to an text/date like: dd.MM.yyyy

Thank you in advance.

HI @M_L

Try with this expression

DateTime.ParseExact(in_Transaction.SpecificContent("Start").Tostring,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd.MM.yyyy")

Regards
Gokul

1 Like

Hi,

Thank you for the fast response.

Seems like there goes something wrong :frowning:

HI @M_L

Try with this expression

DateTime.ParseExact(in_TransactionItem.SpecificContent("Start").Tostring,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd.MM.yyyy")

Note : You need to update the Input parameter

1 Like

Hi,

Still got an error :frowning: String was nog recofnize as a valid Datetime.
It’s like below in Excel.

image

image

image

image

Kind regards :slight_smile:

Hi @M_L

Print the Date in the log message and get the date format from it.

in_TransactionItem.SpecificContent("Start").Tostring

And update the date format in the expression and check it

image

Regards
Gokul

1 Like

Try this expression @M_L

It will work on all formats you just need to add the other format in the string of array

DateTime.ParseExact(in_TransactionItem.SpecificContent("Start").Tostring,{"dd-MM-yyyy","dd.MM.yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("dd.MM.yyyy")
1 Like

Thank you, my date notation was dd/MM/yyyy 00:00:00. Works now :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.