• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System TimeStamp

 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would I get the System timestamp in MYSQL?

I have done like below.

SELECT now();

But it does't give exactly my System datetime.


thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34218
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anvi,
Now is correct. What do you mean that it doesn't give you exactly the current timestamp? How much is it off by?
 
ahamed irshad
Ranch Hand
Posts: 31
C++ Notepad Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use this query

select sysdate from dual
 
Jan Cumps
Bartender
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ahamed irshad wrote:you can use this query

select sysdate from dual
Does that work for MySQL?
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi anvi,

Do you use "now()" function in a trigger or procedure? "Now" does return the exact time that triggering event started, unlike "sysdate()". If you need to get the exact time when the now/sysdate line is executed you should use "sysdate()".

You may take a look at the manual.

Regards,

Fatih.
 
ahamed irshad
Ranch Hand
Posts: 31
C++ Notepad Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i mean sysdate() only

 
ahamed irshad
Ranch Hand
Posts: 31
C++ Notepad Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this link


http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic