format datetime inside HTMLTextBox expression - remove seconds

2 posts, 0 answers
  1. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 09 Aug 2016 Link to this post


    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:

    What change should I make here?

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

    I have read:

    But neither of these answered the question.

  2. Stef
    Stef avatar
    3610 posts

    Posted 09 Aug 2016 Link to this post

    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.

    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
Back to Top