Getting time() read out from a prior date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Getting time() read out from a prior date

Post by HiddenS3crets »

I want to get the type of output that

Code: Select all

<?php
echo time();
?>
outputs using prior months and years, like the time() output for April 2005, December 2004, etc
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

date()

..

Code: Select all

<?php echo date('m d Y', time()); ?>
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Post by HiddenS3crets »

No, that's not what i want. I need to get timestamps from past dates, not the current date
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

oh sorry

use strtotime()
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

http://www.php.net/mktime

so you aren't relying on the wording of the time
Post Reply