God dam dates
-
Good day my friends. I am having a few issues with dates. It's like this. Textbox auto populates on page load with todays date in english format (day/month/year). Then when I go to use this and stuff it in the database I get an error, pretty much cos the date is in the wrong format. So I added in the code to alter this to the correct (American) format for the db. This worked fine until code was passed over to my web server and then it stopped being happy about the format of the date from the text box. How do I get around this issue without getting to complex. Code is as follows
Dim ExpiryDate As String = Convert.ToDateTime(ExpiryDateTB.Text.Trim()).ToString("MM/dd/yyyy")
-
Good day my friends. I am having a few issues with dates. It's like this. Textbox auto populates on page load with todays date in english format (day/month/year). Then when I go to use this and stuff it in the database I get an error, pretty much cos the date is in the wrong format. So I added in the code to alter this to the correct (American) format for the db. This worked fine until code was passed over to my web server and then it stopped being happy about the format of the date from the text box. How do I get around this issue without getting to complex. Code is as follows
Dim ExpiryDate As String = Convert.ToDateTime(ExpiryDateTB.Text.Trim()).ToString("MM/dd/yyyy")
When updating the database do as follows I'm a C# guy but here is close to what you should do. Dim datetime d; if datetiem.tryparse(this.ExpiryDateTB.Text, out d) = true sqlparameter prm = new sqlparameter("@yourParam", d) do updates.
I didn't get any requirements for the signature
-
Good day my friends. I am having a few issues with dates. It's like this. Textbox auto populates on page load with todays date in english format (day/month/year). Then when I go to use this and stuff it in the database I get an error, pretty much cos the date is in the wrong format. So I added in the code to alter this to the correct (American) format for the db. This worked fine until code was passed over to my web server and then it stopped being happy about the format of the date from the text box. How do I get around this issue without getting to complex. Code is as follows
Dim ExpiryDate As String = Convert.ToDateTime(ExpiryDateTB.Text.Trim()).ToString("MM/dd/yyyy")
Use a UTC format to store your datetime. That way you eliminate the differences in culture. Also, I think you could choose a more appropriate subject than, God dam dates!! It's offensive and does not follow the guidelines. See How to get answers post at the top.
only two letters away from being an asset