Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / March 2006

Tip: Looking for answers? Try searching our database.

Changing a Date Time Value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bh - 17 Mar 2006 12:11 GMT
I have a form with a date time picker or it and a button.  When the button is
pressed it passes the date/time into a stored procedure that queries an SQL
database.  Because the date time format is different I am receiving an error.

I want the date format to be “dd-MMM-YYYY HH:MM:SS” e.g. “31-Dec-2006
23:59:59”

I think I need to use the CDate function but I cant seem to get it to work.  
Please help!
Michael Nemtsev - 17 Mar 2006 22:22 GMT
Hello bh,

Use DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss");

b> I have a form with a date time picker or it and a button.  When the
b> button is pressed it passes the date/time into a stored procedure
b> that queries an SQL database.  Because the date time format is
b> different I am receiving an error.
b>
b> I want the date format to be “dd-MMM-YYYY HH:MM:SS” e.g. “31-Dec-2006
b> 23:59:59”
b>
b> I think I need to use the CDate function but I cant seem to get it to
b> work.  Please help!
b>
---
WBR,
Michael  Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
Kolbis Guy - 26 Mar 2006 23:58 GMT
Hi bh,

In my opinion you should not be using date and time in the database, but a
long variable that represents the number of ticks in since a certain date.
The reason for that is the windows current culture.

Regards,

> I have a form with a date time picker or it and a button.  When the button is
> pressed it passes the date/time into a stored procedure that queries an SQL
[quoted text clipped - 5 lines]
> I think I need to use the CDate function but I cant seem to get it to work.  
> Please help!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.