NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Help (mktime)

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-20-2006, 03:02 PM THREAD STARTER               #1 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




Help! Help (mktime)


PHP Code:
$timeout 15;
$t_stamp mktime(date('H'),date('i')-$timeout,date('s'));
die(
$t_stamp); 
That should return the time (in mysql format) 15 minutes ago, but it dosnt. It dosnt return anything.
????: NamePros.com http://www.namepros.com/programming/229806-help-mktime.html

Whats wrong?
Barrucadu is offline  
Old 08-20-2006, 03:31 PM   #2 (permalink)
NamePros Regular
 
Noobie's Avatar
Join Date: Feb 2006
Location: Montreal, Quebec, Canada
Posts: 324
Noobie is on a distinguished road
 



echo $t_stamp;
die();

why?
die() does not print integers
die("$t_stamp");
works too
__________________
Goldkey.com is a scam
What's your BMI? | Timestamp Generator
Noobie is offline  
Old 08-20-2006, 03:58 PM THREAD STARTER               #3 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




It dosnt print integers?

*feels stupid now*

lol

--edit--

Now I have a different problem:

PHP Code:
    function Update_Stats($timeout,$stats){
        
$t_stamp mktime(date('H'),date('i')-$timeout,date('s'),0,0,0);
????: NamePros.com http://www.namepros.com/showthread.php?t=229806
        
        
$this->Database_Query('delete from ' .$stats ' where visited < '.$t_stamp);
    } 
the field visited is a mysql time.
It should delete all entries where visited is more than 15 mins ago, but it deletes everything.
Last edited by Mikor; 08-20-2006 at 04:07 PM.
Barrucadu is offline  
Old 08-20-2006, 04:09 PM   #4 (permalink)
NamePros Regular
 
Noobie's Avatar
Join Date: Feb 2006
Location: Montreal, Quebec, Canada
Posts: 324
Noobie is on a distinguished road
 



i'm not sure why, but you can use int for timestamps
__________________
Goldkey.com is a scam
What's your BMI? | Timestamp Generator
Noobie is offline  
Old 08-20-2006, 08:01 PM   #5 (permalink)
NamePros Member
Join Date: May 2006
Posts: 160
TwistMyArm is on a distinguished road
 



PHP timestamps and MySQL datetimes are not the same thing... it all depends on your column types.

There is a MySQL function called something like UNIXTIMESTAMP that will return a MySQL date as a timestamp and I know there's one for converting from UNIX to MySQL, but I don't know it off the top of my head. However, do some digging for UNIXTIMESTAMP and you're bound to find the 'reverse' function name.
TwistMyArm is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 07:12 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger