Online time/age/total online time

Started on the old forum in April 2010 · view the original in the archive · old links redirect here

2 replies · 620 views · started 16 years ago · 1 min read

2 participants
manavworld Developer · 118 posts #1

I am getting error in age of users, online time and maximum online time.. Its aprearing like, 14720days,145724hour,545632mints,6826457second, am using code *24 *60 *60 help me what is correct code of it

ksg91 Developer · 162 posts #3

well if you have secoonds in $sec variable then you can use it like this

<?php
$year=floor($sec/(365*24*60*60));
$sec=$sec%(365*24*60*60);
$day=floor($sec/(24*60*60));
$sec=$sec%(24*60*60);
$hour=floor($sec/(60*60));
$sec=$sec%(60*60);
$minute=floor($sec/(60));
$sec=$sec%(60);
echo "Time= $year years, $days days, $hour hours, $minute minutes and $sec seconds";

check if this works or not.

Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close