needs some clarification of the date() function of php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
urboyfriend
Forum Newbie
Posts: 11
Joined: Tue Sep 06, 2011 6:29 pm

needs some clarification of the date() function of php

Post by urboyfriend »

say for example a user uses a remote computer to access a php file from a server, the page is a reply form where the user could input some text. After the user pressed the submit button, the message and date-time(date function was used) is recorded to the server. The date-time that got recorded was the current date on the remote computer, not from the server.

am i missing something?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: needs some clarification of the date() function of php

Post by califdon »

The PHP date() function returns the date-time of the server operating system in the time zone specified in the PHP configuration file. If some other date-time is being recorded, either it is being sent from the client or the server code does something else to adjust for the time zone of the client. Without seeing the code, there's no way to answer your question.
urboyfriend
Forum Newbie
Posts: 11
Joined: Tue Sep 06, 2011 6:29 pm

Re: needs some clarification of the date() function of php

Post by urboyfriend »

nvm got the idea whose current date-time is being recorded
Post Reply