Thread: [GENERAL] Clients in different Time Zones
Hi All, I have written a small help desk database using pgsql, Linux, apache and PHP3 to generate HTML pages. The system in itselfworks well but I have staff from four different time zones using the system. As it stands now, when a new job is entered, the date in and time in fields are primed with the current date and time usingdate("d-M-Y") and date("H:i:s", time()). This is fine but it inserts the details from the server time zone (fine forme but the others are up to two hours off). Is there any way that these fields could be primed with a time and date, taking the client's local time zone or local systemtime into account so that they see their local time instead of my server time? TIA, Gary MacMinn
Hello, On Tue, 14 Dec 1999, Gary MacMinn wrote: > As it stands now, when a new job is entered, the date in and time in > fields are primed with the current date and time using date("d-M-Y") > and date("H:i:s", time()). This is fine but it inserts the details > from the server time zone (fine for me but the others are up to two > hours off). Do the different sites run the PHP application from a local server, and connect to a remote database? If this is the case, one solution is to change the code in the PHP script so that you set a variable relevant to the time zone. You then use this to alter time data you select from tables before displaying it on screen. It could work by just being an offset in hours from the database time server. Or if everyone uses the same script then you could tell by the users login which site they are in and then change the time accordingly. Regards, Mark. -- Mark Jewiss Knowledge Matters Limited http://www.knowledge.com