0

hi,

I'm using xampp.
By using phpMyAdmin,

select now() from dual

it shows 2011-02-14 07:28:57 but suppose today's date is 2011-02-15 07:28:57
is there anyone have rough idea where the date set?

i've check the server date is correct 15 feb

thankx

6
Contributors
18
Replies
19
Views
6 Years
Discussion Span
Last Post by htmlCoder101
0

i've select the correct time zone and still the same ..
is there any where that in the xampp set the time?

-1

Open C:\xampp\php\php.ini file in your notepad text editor and look for this section:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "CURRENTIMEZONE"

Go to this link http://us2.php.net/manual/en/timezones.europe.php to get your time zone and replace the Europe/Helsinki with your own time zone ie. Europe/Athens so it now looks like this

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "YOURNEWTIMEZONE"
Save the php.ini file and restart Apache to have those changes recognized.
0

thankx Jeff
i've stop apache and found the [Date] and already change accordingly to mytimezone
then start back apache
but the time still taking US timezone.
i'm very sure that i've my computer timezone is correct.

Status = not settle yet

0

you can test to see what the default timezone on the server is set with the PHP command ‘date_default_timezone_get’. That should tell you what your computer is assuming is the default timezone.

0

result showing Asia/Kuala_Lumpur which i set at the php.ini

my task is to get the Entry date time
so when inserting to database i use now() as the input.
is there any ways to get the current date time while inserting db?

0

mysql is no() you are right. i think curdate() might work not sure though

it's just weird because mysql gets its date information from the local machine ?

0

if using curdate() it only catch the date without time.
the worse thing is i have to get the date and time that's why i choose now()

soo sad but true .. it should get from local machine itself but don't know what went wrong.

Edited by ctkam: n/a

0

i've select the correct time zone and still the same ..
is there any where that in the xampp set the time?

Did you restart the MySQL server after changing the time zone?

Edited by mwasif: n/a

0

yes .. have stop and start back the mysql and apache

0

the sad thing is .. i couldn't figure out how to manage this issue yet

1

Have You checked all of these three statements?

SELECT CURRENT_TIMESTAMP
SELECT {fn NOW()}
SELECT GETDATE()

Edited by abelLazm: n/a

Votes + Comments
good point out
0

im still not sure of the solution but interested in learning it. not sure why i got a -1 rep on one of my posts here tho :|

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.