• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How ti get the current time on the database server?

 
Cameron Bruce
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to get the current time on the remote database server?
All I have is the URL (contains the IP address).
thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on how you want to get it. All DBMS have a function to get the current time. MySQL, you can use the NOW() function and that will fetch the time on the server. If you are using Servlets of anykind, you could write a simple servlet to get the current time on the Server.
Hope that points you in the right direction.
 
John Haake
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For an oracle database server:
SELECT TO_CHAR( sysdate, 'HH24:MI:SS' ) FROM DUAL
which, of course, returns a String result.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic