Fetch current server time

Ghanem

New member
Local time
Tomorrow, 01:31
Joined
Apr 20, 2007
Messages
3
I have an access form that retrives information from mysql database, mysql database is on seperate server on the network

How can I assign a text box to contain the current mysql server time, as I don't want the form to depend on the users machine time because they can change it..
 
http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html

I'd imagine that the above link will get you started - my guess is that you'd want to create a stored procedure (or whatever they're called in the mysql world) that returns the server's time. Then you can execute it to get the current time (possibly adjusting for time-zone info).
 
Last edited:
http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html

I'd imagine that the above link will get you started - my guess is that you'd want to create a stored procedure (or whatever they're called in the mysql world) that returns the server's time. Then you can execute it to get the current time (possibly adjusting for time-zone info).
Thank you BrettStah
I found a solution, a wourk arround actuly..
I have created new table that contained time filed with current_timestamp as default value
I called it form the form, when the user clicks the button assigned, it will create new record in the time table at the same time, the server time will be stored then :)
 
I'm not entirely sure of the syntax in Mysql, but wouldn't a stored procedure that returns:

SELECT right(getdate(),7)
(which returns the current time from SQL Server)

as an output variable save a bit of huffing and puffing creating records into a table to generate a timestamp?
 

Users who are viewing this thread

Back
Top Bottom