Jump to content

Time conversion


arunkar

Recommended Posts

Hi Experts,

 

I did a simple sql to pull out the members registered today. It so happened that my hosting server is some where in US and I'm in Singapore. The Server in US is 15 hrs behind Singapore time. example (when it Tuesday, April 1, 2008, 9:10 am in our server time, in Singapore its Wednesday, April 2, 2008, 12:10 am ).

 

So when I pull out the total registrations for today, I don't get the actual result According to local Singapore time. Singapore is +8 GMT. I think our server must be -7 GMT (I'm not sure), as there is 15hrs difference.

 

This is the SQL I'm using to pull out the current registrations:

$result = mysql_query("SELECT name, lastname, email, registerDate, client_type FROM jos_users WHERE DATE(registerDate) = CURDATE() AND client_type = '$MRValue'");


<table border="1" cellspacing="0" cellpadding="0">
<tr class="TblHeading">
<td>First Name</td>
<td>Last Name</td>
<td>Email</td>
<td>Registration Date</td>
<td>Client Type</td>
</tr>
<?php
while($r=mysql_fetch_array($result))
{	
print"<tr>";
print "<td class='TblData'>".$r["name"]."</td>";
print "<td class='TblData'>".$r["lastname"]."</td>";
print "<td class='TblData'>".$r["email"]."</td>";
print "<td class='TblData'>".$r["registerDate"]."</td>";
print "<td class='TblData'>".$r["client_type"]."</td>";
print"</tr>";
}

mysql_close($link);

?>
</table>

 

 

Is there a way to show all the registrations based on one full day of 24hrs in Singapore?

 

Is there a way to make my code work faster as its very slow now?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/98994-time-conversion/
Share on other sites

Hi,

 

Just a little more info just in case,

 

The time zone of my server is -05:00 GMT, New York.

 

THis is the sql I'm using

 

$result = mysql_query("SELECT name, lastname, email, registerDate, client_type FROM jos_users WHERE DATE(registerDate) = CURDATE() AND client_type = '$MRValue'");

 

any ideas?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/98994-time-conversion/#findComment-508081
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.