This topic is locked
[SOLVED]

 Remote server data/time

4/12/2011 9:18:02 AM
PHPRunner General questions
B
bobdansei author

is there some function I use to get the remote server time? like: now()?

Sergey Kornilov admin 4/12/2011

What "remote server" means? PHP application is executed on the server and now() returns that server time.

B
bobdansei author 4/12/2011



What "remote server" means? PHP application is executed on the server and now() returns that server time.


well I have an event that saves the date after later add and i need only the server time cause in my network I have a lot of people in my network with daylight schedule on their local machine so I wanted to save the sql/php server time in field.
global $dal;
$tblDetail = $dal->Table("dbo.TB_Ticket");
$tblDetail->Value["DataHoraUltimoEvento"] = now();
$tblDetail->Param["IdTicket"] = $values["IdTicket"];
$tblDetail->Update();
unset($values["IdTicketRespostaStatus"]);

Sergey Kornilov admin 4/12/2011

PHP code is executed on the web server and doesn't have access to date/time settings on the client machine.
It might be possible to find client time using Javascript and pass it to PHP code via form however this is not 100% reliable and leads to some problems if time on clients machine is off or you need to sort data by date added.

N
nti 4/12/2011

If using MySql: You could utilize timestamp field which provides date and time for New Rec Added and/or rec edit.

B
bobdansei author 4/13/2011



If using MySql: You could utilize timestamp field which provides date and time for New Rec Added and/or rec edit.


i am using mssql and i was using a similar idea only for add but use it for edit too is a nice idea tnks