This is a migrated thread and some comments may be shown as answers.

Date plus time format

1 Answer 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Frans
Top achievements
Rank 1
Veteran
Iron
Frans asked on 16 Mar 2021, 10:06 AM

Hi,

How can I achieve a column formatted to show buth date as time part. Something like: dd-MM-yyy HH:mm:ss

I tried this format, but it showed only the date part.

And also: how can I achiveve this dependdant of the users' culture ? (available in my application in bith a serverside as a clientside variable).

I prefer to achieve this serverside.

Martin

 

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 Mar 2021, 06:54 AM

Hello Frans,

You can use the Format columns property to set format for the for displaying the data. For example:

columns.Bound(x => x.Birthday).Format("{0: dd-MM-yy HH:mm:ss}");

Another possible approach is using a ClientTemplate:

columns.Bound(x => x.Birthday).ClientTemplate("#= kendo.toString(Birthday, 'dd-MM-yy HH:mm:ss') #");

More about date formatting can be found in the following article:

Let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Frans
Top achievements
Rank 1
Veteran
Iron
Answers by
Nikolay
Telerik team
Share this question
or