Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 12, 2009 04:37 AM by Alagiri
Apr 17, 2006 08:46 PM|LINK
i'm making application using vb.net. i want to get current date from system. It'll be shown on aspx page then i want to insert it in database. how can i do that??
Apr 17, 2006 09:02 PM|LINK
Apr 17, 2006 09:05 PM|LINK
Apr 17, 2006 09:13 PM|LINK
Apr 17, 2006 09:16 PM|LINK
i want to show it on the web page also. how can i show date on the web page?
<asp:Label ID="CurrentTime" runat="server" />
CurrentTime.Text = DateTime.Now.ToString()
Apr 17, 2006 09:35 PM|LINK
Apr 17, 2006 09:39 PM|LINK
now i want to store it in database also. I'm using sql server 2000. i've set data type as date/time.
Here's three ways you can approach that:
1) Pass System.DataTime.Now to the SQL query or stored procedure
2) Use GETDATE() in a stored procedure
3) Set GETDATE() as the default value for the date/time column in SQL Server
Apr 17, 2006 09:54 PM|LINK
is it feasible to write this function as; this is for business layer
_CurrentDate = Value
while for aspx.vb
CurrentDate.Text = DateTime.Now.ToString()
objCustomer.currentDate = txtDate.Text
Oct 16, 2008 01:01 AM|LINK
thanks for your post regarding the system date to string. Many hours wasted, now sorted thanks to you.
Jan 29, 2009 12:13 PM|LINK
Thank you for the code. When I use this code in visual web developer 2008, it will display the date and the time in the following format:
Current Date/Time: 2009-01-28 05:09 .
How do I get it to display AM or PM as well? For instance 5:09 am