Bitcoin Forum
May 05, 2024, 09:22:37 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: PHP Time Help - CGMiner RPC API Monitoring  (Read 1408 times)
bitlane (OP)
Internet detective
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


I heart thebaron


View Profile
January 31, 2012, 06:21:18 AM
 #1

I am currently still working on modifying an RPC Monitoring web page app that jjimmy_64 started for CGMiner and I have a quick question in regards to PHP Time.



I am using gmdate and elapsed time to calculate/display my Miner's uptime.
This works great, but what I just realized is that it's only good for a 24hour period and I do not know the PHP or gmdate variable to use to display DAYS.

I am using:
Code:
UPTIME (H/M/S): ".gmdate("H:i:s", $elapsed)."

I have tried a bunch of ways and the closest I have come is to have DAYS (when added) displayed as 1, even after just starting the miner and displaying a few minutes of uptime.

Alternatively, is there a way I can keep HOURS rolling PAST the 24hour mark and just keep adding up, rather than rolling over and expecting a DAY portion of the script there to display ? I don't mind haivng it show "100hrs uptime" etc.....

Could anyone offer some help ?

I am a shitty coder, but a great copy/paster Wink

Thanks in advance,
bitlane.

Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714944157
Hero Member
*
Offline Offline

Posts: 1714944157

View Profile Personal Message (Offline)

Ignore
1714944157
Reply with quote  #2

1714944157
Report to moderator
1714944157
Hero Member
*
Offline Offline

Posts: 1714944157

View Profile Personal Message (Offline)

Ignore
1714944157
Reply with quote  #2

1714944157
Report to moderator
1714944157
Hero Member
*
Offline Offline

Posts: 1714944157

View Profile Personal Message (Offline)

Ignore
1714944157
Reply with quote  #2

1714944157
Report to moderator
notme
Legendary
*
Offline Offline

Activity: 1904
Merit: 1002


View Profile
January 31, 2012, 06:52:48 AM
 #2

http://php.net/manual/en/function.time.php

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
January 31, 2012, 05:51:44 PM
Last edit: January 31, 2012, 09:46:19 PM by Bitsky
 #3

Code:
$days=floor($elapsed/86400);
$time=gmdate('H:i:s', $elapsed%86400);

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!