Arsip: [Help] - Zeos MySQL ServerDateTime

 
user image
more 16 years ago

rydz™

Hi, anyone know how to display our date and time in mysql server using zeos ?
user image
more 16 years ago

Hadoitz

no idea :(
user image
more 16 years ago

LuriDarmawan

try:
SELECT NOW();
tinggal jalankan dari si zeos
user image
more 16 years ago

rydz™

i googled and found some code to display our date/time from mysql server :
qry.SQL.Add('SELECT CURRENT_TIMESTAMP AS ServerDateTime');
qry.Open;        
Result := qry.FieldByName('ServerDateTime').AsDateTime;
But Zeos return me errors on ServerDateTime, anyone can give me some ideas to get time from MySQL server?
user image
more 16 years ago

ImanD

@rydz™ type data of var Result ? try this:

var
  hasil: TDateTime;
begin
  with ZQuery1 do
  begin
    Close;
    SQL.Text:='SELECT CURRENT_TIMESTAMP AS ServerDateTime';
    Open;
    hasil:=FieldByName('ServerDateTime').AsDateTime;
    ShowMessage(FormatDateTime('yyyy-mm-dd hh:mm:ss',hasil));
  end;
end;
successfully !
user image
more 16 years ago

rydz™

Thanx for da information, but it is possible integrated with a Timer? What should i do?
user image
more 16 years ago

herux

Why not? what do u know about that ?
user image
more 16 years ago

deepblue

perintah sqlnya: select {fn NOW()} as Time dicoba.. Regard, Dedy John
more ...
  • Pages:
  • 1
Share to

AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now: https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com