How to get date without datetime? [duplicate]

1

Within the variable date I have this:

Hereisthecodeinhtml:

<inputtype="text" class="form-control" readonly disabled value="@Model.Data">

Final result:

What is the simplest way to get a date? (date without time)

    
asked by anonymous 18.01.2017 / 03:38

1 answer

2

Matheus,

Use the code below to get the date without the time.

@Model.Data.ToString("dd/MM/yyyy")

Hugs,

    
18.01.2017 / 03:49