DateTime Convert

I Need convert a datetime variable;

My datetime variable is “MM/dd/yyyy hh:mm:ss” and i need “dd/MM/yyyy” , but i can not transform my variable to string, because I will use this variable like a parameter in a procedure

Help-me please

DateTime variables have no format they are objects… formats are just string representations of that date.

1 Like

Exist any variable just date? not datetime, I need only date

no…

@Mths_Teixeira - as @bcorrea mentioned, a datetime variable is exactly that - it is an object representing a date & time.

I believe you are talking about the string representation of that date & time. Wherever you are putting this string, just include the correct format when converting your datetime to string. For example, you would put in a write line activity: MyDateTimeVariable.ToString("dd/MM/yyyy") - this will show the datetime in the format you specified.

See more about the datetime → string formats here: Custom date and time format strings | Microsoft Learn

2 Likes