We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Blazor DataGrid (sFGrid) GridColumn Datetime Custom Formats

Hello, 

Could you please link the documentation on all avaliavle datatime formats to use in a data-grid column.

EXAMPLE:

<GridColumn Field=@nameof(FMDowntimeFrmEntryS.EndTime) HeaderText="EndTime" Width="75" Format='MM/dd/yyyy HH:mm'></GridColumn>

In the example above the data and time is formatted correctly however it is in Zulu time (10/11/2022 14:40) which does not display times in AM or PM format. What is the correct format for the date output of 10/11/2022 2:40 PM?

Thanks!


3 Replies 1 reply marked as answer

NP Naveen Palanivel Syncfusion Team October 13, 2022 01:32 AM UTC

Hi Mike,


  Greetings from Syncfusion support.


  Based on your query, you want to display times in AM or PM format to displayed in your grid. Your requirement can be achieved by using  the ` Format="MM/dd/yyyy hh:mm tt"`.


Please refer the below code example.


        <GridColumn Field=@nameof(Order.OrderDate) HeaderText="Order Date"  Format="MM/dd/yyyy hh:mm tt" TextAlign="TextAlign.Right" Width="130" Type="ColumnType.Date"></GridColumn>

        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>



Please get back to us for further details.


Regards,

Naveen

 


Marked as answer

MV Mike Vinson October 13, 2022 02:11 PM UTC

Great, thank you Naveen!



NP Naveen Palanivel Syncfusion Team October 14, 2022 03:28 AM UTC

Hi Mike,


Welcome


Please get back to us if you need further assistance.


Regards,

Naveen .


Loader.
Live Chat Icon For mobile
Up arrow icon