The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I want the time to show in military format such that 1:00PM should appear as 13:00. When the user inputs 1:00 in the textbox, I wrote some codes in the textbox's LEave event to format the textbox into long time as below but it doesn't work. This code just truncates the
txtTime.text = FormatDateTime(txtTime.text,
DateFormat.LongTime)
all it does is change the time to include seconds such as 1:00:00 PM. but i don't want that. How do I format it to military time?
CBClay Burch Syncfusion Team July 10, 2002 07:53 AM UTC
In the help on FormatDateTime, it says that DateFormat.LongTime uses the system settings. If you want to use 24 hour format, it says to use DateFormat.ShortTime.
ADAdministrator Syncfusion Team July 11, 2002 08:38 AM UTC
But it's not one of the options! if i try to format datetime.shorttime, i get an error. it's not one of the choices that comes up when i press the "dot" after the datetime! why is that?
CBClay Burch Syncfusion Team July 11, 2002 02:43 PM UTC
In your original code, you had DateFormat.LongTime. I am suggesting DateFormat.ShortTime as in: