Forums

PHP

This topic is locked

PHP MYSQL DATE Problem

Posted 02 Jun 2005 05:14:04
1
has voted
02 Jun 2005 05:14:04 adam zerner posted:
Hi Guys

I am having a strange problem with an php and/or mysql. I have built an intranet that allows two users to post 'things to do' for each other, every time a post is made I have the date added so that it shows when it was posted. My problem is that the dates for all posts read out as 30th November 1999. I have a live shopping cart on the same account with its own mysql databse and the dates are accurate on that.

This makes me think I have done something wrong with php. It is obviously not reading the current date, do i need to tell the database to record the current date through php?

Any help or suggestions would be much appreciated.

Replies

Replied 24 Jun 2005 18:36:20
24 Jun 2005 18:36:20 Noel Stratton replied:
Have you looked in the database to see what date it has. I use phpmyadmin to view database results. Anyways it might be wrong there. I have noticed with Dreamweaver on the insert record feature will insert the date as a date. Sounds right, but I noticed it causes problems. My fix was to insert it as text. However you need to make sure the user enters the date as YYYY-MM-DD format.

Reply to this topic