Date Time Field with default time

Posted by Kevin2012 under ASP.NET on 1/31/2012 | Points: 10 | Views : 1139 | Status : [Member] | Replies : 2
Hello,
I am working on a project where i am making text box to enter datetime ( I have field in table delivery_Date), i need to make that field accept some date and default time should be 6 pm unless user want any specific time.
i need to handle default time (6:00 pM) or any user specific time,
i am hoping some help to accomplish this,
date should be in this format (mm/dd/yyyy 06:00PM) by default otherwise users will enter anytime
Thank you,




Responses

Posted by: Gow.net on: 1/31/2012 [Member] Starter | Points: 25

Up
0
Down
try this
  String a=   DateTime.Now.ToString();

else you use datetime picker tool

gowthaman8870226416

Kevin2012, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pradeepkumar417 on: 2/1/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

You can get date in this format (mm/dd/yyyy 06:00PM) by writing below code.

string defaultdt = DateTime.Now.ToShortDateString() + " " + DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString()+"PM";


Thanks & Regards,
Software Engineer,
Pradeep Kumar.


Thanks & Regards,
Software Engineer,
Pradeep Kumar

Kevin2012, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response