How get current_time server mysql ?

How get current_time server mysql ?

Postby vilian » Wed Feb 03, 2010 1:14 pm

Hi,

I use TMySql and need get current_time in server mysql. anyone know how?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How get current_time server mysql ?

Postby nageswaragunupudi » Wed Feb 03, 2010 3:34 pm

MySql functions:
CURDATE() or CURRENT_DATE // date
CURTIME() or CURRENT_TIME // time
NOW(), SYSDATE() or CURRENT_TIMESTAMP // date and time
Please try using them
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10627
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How get current_time server mysql ?

Postby vilian » Wed Feb 03, 2010 5:23 pm

Thank you,

But I not found the definition of these functions in TmySQL !
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How get current_time server mysql ?

Postby nageswaragunupudi » Thu Feb 04, 2010 7:16 am

You cam open a table with sql query 'SELECT SYSDATE()'
You get the required value in first row, first column of the table
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10627
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How get current_time server mysql ?

Postby vilian » Thu Feb 04, 2010 2:39 pm

ok, it worked. I did so:

Code: Select all  Expand view

     oQuery := TMySQLTable():New(oServer:nSocket,"SELECT curtime()","Teste",.t.)
     cHora := oQuery:FieldGet(1)

     oQuery := TMySQLTable():New(oServer:nSocket,"SELECT curdate()","Teste",.t.)
     dData := oQuery:FieldGet(1)
 
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How get current_time server mysql ?

Postby nageswaragunupudi » Thu Feb 04, 2010 4:10 pm

good.
you can make them as your personal library functions.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10627
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests