How to set server time?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How to set server time?

Postby Sindy » 27. December 2010 12:02

Hi,

this is the php code that i used to insert data to sql database
$Fname = $_POST["Fname"];
$Lname = $_POST["Lname"];
$gender = $_POST["gender"];
$sql="INSERT INTO $tbl_name(firstname, lastname, gender, datetime)VALUES('$Fname', '$Lname','$gender', NOW() )";

when i submit data to database, the datetime data will be auto insert into datetime field. However, the date time is not same with my country time.
eg, data insert into database is (2010-12-25 15:21:36) , but it should be (2010-12-25 23:22:36)
after that, i realized that the datetime value is based on server time

How to change the server time of xampp 1.7.3

Appreciate your help ....thanks...
Sindy
 
Posts: 2
Joined: 27. December 2010 10:41

Re: How to set server time?

Postby NiAlMa » 02. January 2011 11:08

have you set date.timezone in der php.ini correct?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
XAMPP 1.8 for local development/testing
Codeigniter for programming
YAML for Structure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NiAlMa
 
Posts: 50
Joined: 28. March 2008 07:22
Location: Schwabenland
Operating System: WU7x64

Re: How to set server time?

Postby Sindy » 04. January 2011 02:53

thanks 4 reply...

im beginner of xampp. So, i not sure whether i set it correct or not.......

may i know how do check or set date.timezone in der php.ini ?

for you information, im from Malaysia.......
Sindy
 
Posts: 2
Joined: 27. December 2010 10:41

Re: How to set server time?

Postby Altrea » 04. January 2011 03:17

In your XAMPP Backend is a link to a phpinfo() function.
In this report search for "Default timezone" and "date.timezone"
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 129 guests