Convert double to a datetime

Hello i am trying to perform something. I am getting a double value thats the format “20200308”
i want to format this into a datetime format and formatted this way 2020-08-03

Anyone know how ? thanks in advance

Convert.ToDateTime(your_variable).ToString(“your_format”)

Thanks

1 Like

@langsem
DateTime.ParseExact(YourStringVar, “yyyyddMM”, CultureInfo.InvariantCulture).toString(“yyyy-MM-dd”)
assumed 8 ist Month

ensure following:
grafik

3 Likes

I want the output to be a string with the dateformat. Shall i just assign it to a string ?

It worked :D!" THanks m8

a datetime can be formated on string base onto another format representation. the internal representation of a date time will not be changed ( is not to modify). Yes. It will be string (Have a look on the screenshot column datatype)

1 Like

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