aspose file tools*
The moose likes JDBC and the fly likes System TimeStamp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "System TimeStamp" Watch "System TimeStamp" New topic
Author

System TimeStamp

anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
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

Joined: May 26, 2003
Posts: 30938
    
158

Anvi,
Now is correct. What do you mean that it doesn't give you exactly the current timestamp? How much is it off by?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
ahamed irshad
Ranch Hand

Joined: Feb 26, 2010
Posts: 31

you can use this query

select sysdate from dual


You can do anything, but not everything
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2510
    
  10

ahamed irshad wrote:you can use this query

select sysdate from dual
Does that work for MySQL?


OCUP UML fundamental and ITIL foundation
youtube channel
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
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

Joined: Feb 26, 2010
Posts: 31

i mean sysdate() only

ahamed irshad
Ranch Hand

Joined: Feb 26, 2010
Posts: 31

try this link


http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: System TimeStamp