formatting dates in SQL (Pure ASP)
Posted on 2014-08-21
When a client updates a certain table (filling a form and therefore inserting data into the SQL server database) a certain "LastUpdated" field is filled/updated... this is done with a hidden "LastDate" field in the form, with value "<% Now %>" .
This works fine in almost all situations, filling the LastUpdated field with values such as "2014-08-12 17:31:59.000" (Aug, 12, 2014). The problem is that in some cases this field, in exactly the same day/time is filled with "2014-08-12 17:31:59.000" and, of course, I have problems related to that.
Question: what could I do to modify <% Now %> so that I could guarantee that the FORMAT of the date of Aug, 12, 2014 would always be saved at my database field as "2014-08-12 17:31:59.000" despite any local configuration at my client place?