---
title: "How to change format of datepicker?"  
description: "How to change format of datepicker?"  
author: "Hemant Patel"  
published: 2017-12-06  
updated: 2017-12-07  
canonical: https://www.mindstick.com/forum/34380/how-to-change-format-of-datepicker  
category: "c#"  
tags: ["mvc", "mvc4", "razor"]  
reading_time: 2 minutes  

---

# How to change format of datepicker?

Hi,

Here is my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii), i want to change my [date picker](https://www.mindstick.com/blog/627/date-picker-using-bootstrap-in-asp-dot-net) [format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format) in my [form](https://www.mindstick.com/forum/6/multi-form-mfc-application).

```
 <div class="col-md-6">
     <label for="dob">DOB</label>
         <div class='input-group date' id='datetimepicker1'>
             @Html.TextBoxFor(x => x.DOB, new { @class = "form-control", placeholder = "mm/dd/yyyy" })
                  <span class="input-group-addon">
                       <i class="fa fa-calendar" aria-hidden="true"></i>
                  </span>
              @Html.ValidationMessageFor(x => x.DOB)
          </div>
</div>
```

## Replies

### Reply by Anonymous User

Hi Harsh,

Kindly add the given line of codes in your form as following :

```
 <div class="col-md-6">
     <label for="dob">DOB</label>
         <div class='input-group date' id='datetimepicker1'>
             @Html.TextBoxFor(x => x.DOB, "{0:MM/dd/yyyy}", new { @class = "form-control", placeholder = "mm/dd/yyyy" })                  <span class="input-group-addon">
                       <i class="fa fa-calendar" aria-hidden="true"></i>
                  </span>
              @Html.ValidationMessageFor(x => x.DOB)
         </div>
</div>
```


---

Original Source: https://www.mindstick.com/forum/34380/how-to-change-format-of-datepicker

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
