String to DateTime Conversion

Hi All,

I have my string value as Str=2/14/22 09:02:07 and i need to store this entire str value along with the timestamp in the database table column. And my database table column is type date. Can any one help me. How can do it.

Thanks.

Hi @prathyusha_gattamaneni

Try with the below expression!

DateTime.ParseExact(row(“Out”).ToString,“M/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).Tostring(“dd/MM/yyyy”)

Regards

try to use date.today.tostring(“dd/MM/yyyy hh:mm:ss”) and use this variable with a write cell or append range activity to store it in the data table

Hi @prathyusha_gattamaneni

Can you tell us from where you will be getting the Str variable value ?

Regards
Gokul

Hi @prathyusha_gattamaneni

Here is the workflow

Sequence1.xaml (8.6 KB)

ArrDate → You can give you any date format.

Regards
Gokul

Hi @Gokul001

I am getting this from a .txt file

Okay so you need to pass that variable in the expression in the above flow

Regards
Gokul