Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,688 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,280 people online right now. Registration is fast and FREE... Join Now!




Getdate

 
Reply to this topicStart new topic

Getdate, erm... help

arniie
post 15 Oct, 2002 - 12:52 AM
Post #1


D.I.C Addict

****
Joined: 8 Oct, 2002
Posts: 999

Ok, Ive got a database table with adverts in

They have a timestamp field for when they uploaded the advert.

I know want to display on the page the advert age - this must mean I need to
get todays date (getdate) Then...?

how do I subtract getdate from the timestamp? to find the advert age???
User is offlineProfile CardPM

Go to the top of the page

arniie
post 15 Oct, 2002 - 02:46 AM
Post #2


D.I.C Addict

****
Joined: 8 Oct, 2002
Posts: 999

Ok Ive worked it out


But - for some reason getdate - gets the time, and its an hour out - presumebly php gets the time from the server its running on, not the local machine???
User is offlineProfile CardPM

Go to the top of the page

Antisoft
post 15 Oct, 2002 - 05:49 AM
Post #3


D.I.C Head

**
Joined: 20 Jun, 2002
Posts: 71

but then you could just make it add one hour?
User is offlineProfile CardPM

Go to the top of the page

arniie
post 15 Oct, 2002 - 06:25 AM
Post #4


D.I.C Addict

****
Joined: 8 Oct, 2002
Posts: 999

sorry - ive got everything working now
right dates

So now i have

Current Time = 20021015152613
Timestamp = 20021014124537

how do i find the age difference

datediff. in php?
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 07:22AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month