1
demian
module - set date format ?
  • 2010/3/6 15:33

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


i made a simple module

i follow standard XOOPS that
in db date is saved as :

date int(10) NOT NULL default '0',


in database it is saved example like this 1267885629

how do i retrieve the date in my page so it look like this

2010/3/1 14:44:58


i tried
$date=$row['date'];
$showdate$date formatTimestamp($date) : '';

echo 
"$showdate";


and it display like this

1970/1/1 7:30:00




what did i do wrong...newbie php

2
ghia
Re: module - set date format ?
  • 2010/3/6 16:09

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Probably $row['date'] is not receiving the database data.
When it contains 0 or is empty, it shows 1970.

3
demian
Re: module - set date format ?
  • 2010/3/6 16:17

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


there is a value for date

cause i echo date it return a value

1267885629

4
demian
Re: module - set date format ?
  • 2010/3/6 16:21

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


ok i changed to this and now its ok..conflict

$mydate=$row['date'];
$showdate$mydate formatTimestamp($mydate) : '';

Login

Who's Online

146 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 146


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits