Datechange

hi
need help by change date formate

have this format:
yyyymmdd

need to print in this format:
ddmmyyyy

thanks

Hi @nir.kail ,

you can use the following expression:

Cdate("DateString").tostring("ddMMyyyy")

or

DateTime.ParseExact("DateString", "yyyyMMdd",System.Globalization.CultureInfo.InvariantCulture).tostring("ddMMyyyy")

Regards,

2 Likes

@nir.kail ,

DateTime.ParseExact(InputDate, "yyyyMMdd",System.Globalization.CultureInfo.InvariantCulture).ToString("ddMMyyyy")

Regards,

@nir.kail

If you are getting value this from an excel then write as below

Cdate(Value).Tostring("ddmmyyyy")

Hope this may help you

Thanks,
Srini

Hi @nir.kail

How about this date expression?

DateTime.ParseExact(StringInput,"yyyymmdd",System.Globalization.CultureInfo.InvariantCulture).ToString("ddmmyyyy")

Regards
Gokul

1 Like

hi
getting this error:

Error ERROR Validation Error Compiler error(s) encountered processing expression “CDate(“DateString”).tostring(“ddMMyyyy”)”.
Option Strict On disallows implicit conversions from ‘String’ to ‘Date’.

@nir.kail Try the other one:

Replace the “DateString” with the date string variable or the date string

DateTime.ParseExact("DateString", "yyyyMMdd",System.Globalization.CultureInfo.InvariantCulture).tostring("ddMMyyyy")

regards,

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