Last post May 12, 2009 05:37 AM by Alagiri
Apr 17, 2006 09:46 PM|bluebird07|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 10:02 PM|bpag|LINK
Apr 17, 2006 10:05 PM|Meson|LINK
Apr 17, 2006 10:13 PM|bluebird07|LINK
Apr 17, 2006 10:16 PM|StrongTypes|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 10:35 PM|bluebird07|LINK
Apr 17, 2006 10:39 PM|StrongTypes|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 10:54 PM|bluebird07|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 02:01 AM|rogerbart|LINK
thanks for your post regarding the system date to string. Many hours wasted, now sorted thanks to you.
Jan 29, 2009 01:13 PM|marjan76|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
Jan 29, 2009 01:34 PM|rogerbart|LINK
Hi, I am not sure as I tend to use 24 hour date format.
Try this link, it seems to have plenty of examples:
Jan 30, 2009 06:58 AM|marjan76|LINK
Great, thank you so much for the link:)
May 12, 2009 05:37 AM|Alagiri|LINK
Hey man,it was too good. You made it possible man. Thank you. COntinue your good work.