Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Echo Date from Recordset 1

Status
Not open for further replies.

vivilady

Programmer
Mar 5, 2005
36
GB
Hi, anyone have any idea why my date is being displayed as 1110288534 in my page. I checked the DB and the date looks fine there but when I echo it out it shows like this
1110288534

here is the echo code

while (!$Recordset1->EOF) {
$maindates = $Recordset1->Fields("maindate");

echo ".$maindates->value.";

$Recordset1->MoveNext();
}

The result on screen like said is: 1110288534 etc even though it has a right date displying in the DB itself.

Any suggestions?
 
No one will have any idea, unless you give us more information. How is the field defined in your database?

Ken
 
it is defined as a general date in access db. and the column name is maindate
 
does that answers the question you needed kenrbnsn? if not please tell me exactly how you want me to re-phrase the question.

Thanks for your help
 
I don't know access db, so I'm only guessing here.

Your DB display program, might be formatting the date field to be "nice", instead of showing you the raw information.

You can try:
Code:
echo date('Y-m-d',$maindates->value);
See the section in the PHP manual on displaying dates.

Ken
 
THANK YOU kenrbnsn !!! You are a genius! it works.
so you can consider yourself as a MYSQL and ACCESS DB guru amongst the other areas that you are already a guru in!

Thank you ever so much...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top