Independent System Time for VB.NET or MySQL

Pablo Umald

I've been searching the web for any search result of making a datetime that is not dependent in the computer's date and time. I am creating a system that requires a datetime to be saved in Mysql DB with VB.net, and i noticed that once i change the datetime of my computer the datetime.now.tostring of vb.net changes to so the transactions i save in mysql db can be compromised.

my question is how will I implement a DATETIME that is not dependent on the computer's DATETIME.

Sam M

In your update or insert statement, use the MySql now() function. It will timestamp based on the database server's time. For example:

UPDATE my_table
   SET field1 = :somevalue,
       field2 = :anothervalue,
       field3timestamp = Now()
 WHERE identifier = :whatever;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related