We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Setting time in DateTimePicker

Thread ID:

Created:

Updated:

Platform:

Replies:

41060 Feb 21,2006 01:48 PM Feb 22,2006 10:47 AM Windows Forms 4
loading
Tags: Tools
John Valescu
Asked On February 21, 2006 01:48 PM

Is there a way to force the time to midnight, 00:00:00 when saving to a SQL server database regardless of the current time? Thanks!

Anupama Roy [Syncfusion]
Replied On February 22, 2006 12:06 AM

Hi, You can consider writing something like this inorder to force the time to "00:00:00" .Here the variable "t" checks for the time and finally returns the value you want. TimeSpan t=this.dateTimePickerAdv1.Value.TimeOfDay; if(t>TimeSpan.Parse ("00:00:00") || t

Anupama Roy [Syncfusion]
Replied On February 22, 2006 12:10 AM

Hi , The code snippet seems to be chewed up.Please take a look at this. TimeSpan t=this.dateTimePickerAdv1.Value.TimeOfDay; if(t>TimeSpan.Parse ("00:00:00") || t

Anupama Roy [Syncfusion]
Replied On February 22, 2006 12:17 AM

Hi, Take a look at the sample for the above mentioned code snippet. Sample Regards, Anu.

John Valescu
Replied On February 22, 2006 10:47 AM

Anu, Thanks for the quick response. I actually want to change the time to 00:00:00 before commiting it to the SQL database. I''ve tried changing some of the members of the class, but most of them are read-only. >Hi, > >Take a look at the sample for the above mentioned code snippet. >Sample > > >Regards, > >Anu. > >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;