aspose file tools
The moose likes JDBC and the fly likes System TimeStamp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply 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
internet detective
Marshal

Joined: May 26, 2003
Posts: 26184
    
  66

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: 2343

ahamed irshad wrote:you can use this query

select sysdate from dual
Does that work for MySQL?


OCUP UML fundamental
ITIL foundation
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: System TimeStamp
 
Similar Threads
recognization of JSP page Change by tomcat
Unique File Name when uploading using FormFile
Timestamp part of java? Import perhaps..
TimeStamp.toString() does not work as expected
Optimistic concurrency in hibernate using version/timestamp.