Home » FAQ » ASP.NET » Basic » What is the best way to output only time and not Date
Use DateTime as follows VB.NET
Response.Write(DateTime.Now.ToString('hh:mm:ss'))
C#
Response.Write(DateTime.Now.ToString('hh:mm:ss'));
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with