Parse current datetime in dd-mm-yy format with time

Hi Everyone,

DateTime.Now
gives output as [09/15/2020 11:49:13]
I need it in dd/MM/yy format with time as datetime object
expected output as [15/09/20 11:49:13]

Thanks

Hi @ramees.pk

Using try DateTime.now.toString(“dd/MM/yy hh:mm:ss”)

@ramees.pk

Check below post

convert.ToDateTime(Now).ToString("dd/MM/yy hh:mm:ss")

Hope this helps you

Thanks

@minhduc and @ksrinu070184
Thanks for the reply
But i required it as datetime variable not string data type
Thanks

@ramees.pk

If we want the Format we need to make it as string


image

else it will convert to default datetime format

Mark as solution if this helps

Thanks