Free Web Hosting Forum
(#1 (permalink))
Old
chibi's Avatar
Junior Member
chibi is on a distinguished road
 
Posts: 22
Join Date: Nov 2010
Unhappy date and time showing as all zeros - 11-22-2010, 11:35 PM

I am a newbie still at this so I will say it the best I can...

I was creating a guestbook using php and mysql, I wanted to display the date of each post on them. I created a time and date table, the time type was set to time and the date type was set to date, nothing more to the tables, other than they both were not null.
The problem is that they all show zeros. 0000-00-00 00:00:00

here is the link to my guestbook page, as you can see i have tested the guestbook alot, haha.
http://chibibel.co.cc/guestbook/index.php
I am guessing if you need code you can view the source for that or I will show you what you need...

BTW, the last two posts only have times because they were inserted inside phpmyadmin, not with the form that I have, and I set the function to show the date and time as "NOW"
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
Leder678's Avatar
Senior Member
Leder678 is on a distinguished road
 
Posts: 1,430
Join Date: Jan 2009
Location: Norway
Send a message via MSN to Leder678
Default 11-23-2010, 05:44 AM

what code are you using to type out the date ?

This code should work: (YYYY-MM-DD HH:mm:SS)
Code:
<?php
echo date("Y-m-d H:i:s");
?>


Follow me on twitter @Mortenrb

W3Fools - Read and learn

Please AT LEAST read the 10 bolded lines of the TOS at:
http://www.000webhost.com/includes/tos.php
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com