Hi @Peter_1985 , Welcome to Microsoft Q&A,
In C#, the class for handling date and time is DateTime
, not Datetime
.
tb_apply_date.Text = DateTime.Now.ToString();
If you want to format the date and time in a specific way, you can use the ToString
method with a format string. For example, if you want to display the date and time in the format "MM/dd/yyyy HH:mm:ss", you can do it like this:
tb_apply_date.Text = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss");
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.