Reputation: 1059
How can I set first day of first month of current year in DateTimePicker
.
eg. I want to show this time format in DateTimePicker
:
01/01/2013
Upvotes: 1
Views: 9329
Reputation: 32661
Set it like this
picker.Value = new DateTime(DateTime.Now.Year, 1, 1);
Upvotes: 0
Reputation: 1499740
Can't you just use:
picker.Value = new DateTime(picker.Value.Year, 1, 1);
? If that doesn't work, please give more context.
Upvotes: 8