Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to modify this codeplex solution http://datetimebyminute.codeplex.com/. Right now the custom field defaults to the date when we add the column to the list when we open the new form.aspx. I want to deafult to todays date when newform.aspx is opened.

Thanks, Has.

share|improve this question
It is worth mentioning that the codeplex project mentioned is a custom SharePoint field control. –  SPDoctor Jan 27 '13 at 9:42

2 Answers 2

datetimebyminute uses sharepoint standard DataTimeControl. DateTimeControl has property named SelectedDate. Below is a code to set current date in this Control

dtControl.SelectedDate = DateTime.Today.Date;
share|improve this answer

Refer the below code for SharePoint DateTime field:

DateTime Control:

<sharepoint:datetimecontrol ID="dtDateTime" runat="server" IsValid="true" IsRequiredField="true" ></sharepoint:datetimecontrol>

c# code:

dtDateTime.SelectedDate = System.DateTime.Now
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.