UWP C# converting DateTime.Now ToString error.

VoyTec 671 Reputation points
2021-08-26T18:17:27.517+00:00

How can I use DateTime.Now.xXx to fit into a string Date?:
string Date = Date.Time.Now.Day.ToString + DateTime.Now.Month.ToString + DateTime.NowYear.ToString;
I want it to work like this...

Developer technologies | Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Sam of Simple Samples 5,546 Reputation points
    2021-08-26T18:43:10.01+00:00
    string Date = DateTime.Now.ToString("ddMMyyy");
    

    Produces:

    26082021
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.