Luckily, there's a way to query a database and return the time.
SELECT getdate() AS timeI put that into my datareader before any query, and bam! There's the time of the SQL server returned as a single tuple in a column named time. I'm not sure on the semantics of it, but in C# it was easily cast to a DateTime object using Convert.ToDateTime().
Updated because now I use MySQL. And the equal call is:
SELECT NOW()
No comments:
Post a Comment