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

format datetime inside HTMLTextBox expression - remove seconds

1 Answer 414 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aron
Top achievements
Rank 2
Aron asked on 09 Aug 2016, 07:52 AM

Hello,

Right now my report show's date time like this: 10/23/2016 6:00:00 PM

However it would be better to appear without the seconds, like this: 10/23/2016 6:00 PM

I want to keep the datetime inside the same HTMLTextBox, I do not want to create a new control. Keeping it in the same control keeps the presentation tight together.

My Expression looks like this: http://screencast.com/t/J0Rtv1z38

What change should I make here?

Can I put C# code here? {Fields.StartDateTime}.ToShortDateString() }

I have read:

http://www.telerik.com/forums/formatting-embedded-expressions

http://docs.telerik.com/reporting/expressions-embedded

But neither of these answered the question.

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 09 Aug 2016, 03:41 PM
Hello Aron,

You can use the built-in Format text function e.g.:
="htmlTextBox1 text {Format('{{0:MMM/dd/yy hh:mm}}',Parameters.Parameter1.Value)}"
The curly brackets are escaped by doubling them.


I hope this helps.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Aron
Top achievements
Rank 2
Answers by
Stef
Telerik team
Share this question
or