Wrox Programmer Forums
|
C# 4.0 aka C# 2010 General Discussion Discussions about the C# 4.0, C# 4, Visual C# 2010 language and tool not related to any specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 4.0 aka C# 2010 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 24th, 2013, 03:03 PM
Registered User
 
Join Date: Feb 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default only date no time

I am using a datetimepicker and only need the date not the date time. How can I just get the date (mm/dd/yyyy) without time (hh:mm:ss) I have set in the format property custom and set the customformat to mm/dd/yyyy -- it still insists to pass mm/dd/yyyy hh:mm:ss to my variable.

DateTime StartDate = this.dtpStartDate.Value

the StartDate needs to be datetime datatype because that is what the parameter is in my stored procedure that it is populating.

The problem is when the stored procedure is executed within sql server with date range of 9/1/2013 to 9/30/2013 it pulls data for that date range. When i use the datetime from the datetimepicker in my code the stored procedure pulls data for 10/1 as well.
 
Old October 24th, 2013, 03:53 PM
Registered User
 
Join Date: Feb 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default fixed

I used this.dtpStartDate.Value.Date and that did the trick. Thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Time Field not displaying Date and Time webmeister Access 2 January 31st, 2011 12:49 AM
Extracting Time from Date/Time Navy1991_1 XSLT 2 June 3rd, 2008 12:03 PM
date and time in EST time zone anboss XSLT 1 May 21st, 2008 01:42 PM
How to retieve only the date not date and time debjanib ASP.NET 1.0 and 1.1 Professional 2 July 25th, 2006 01:10 PM
insert system date. no date and time jimmy Access VBA 6 November 20th, 2003 01:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.