How to convert date format

studio
variable

#1

Hi,

I have date in format “2.1.2018” (d.m.yyyy). Need to get it in this format: “20180102” (yyyymmdd). How can it be done, days and months have to have leading zeros.

Thanks,

-mikko


#2

First you read the date into a DateTime variable, as shown here:

Then you output to string in the format you want (“yyyyMMdd”) like this:

Details: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings


#3

Ok, Thanks! I give it try.