Calculate Days.
#1

how do I calculate the days from timestamp?
Код HTML:
stock Days(timestamp) { return (gettime( ) - timestamp) / 86400; }
Not work...
Exemple of timestamp: 1467387606
Reply
#2

Do you mean day, months, year ?
PHP код:
        gettime(hourminutesecond);
        
getdate(yearmonthday); 
Reply
#3

Код:
stock GetDays()
{
	new days = gettime();
	days = days/60/60/24;
	return days;
}
Reply
#4

Quote:
Originally Posted by Matz
Посмотреть сообщение
Код:
stock GetDays()
{
	new days = gettime();
	days = days/60/60/24;
	return days;
}
Not work.
pMeanUser = 1467387606;
GetDays(pMeanUser);
Reply
#5

PHP код:
GetDay()
{
    new 
yearmonthday;
    
getdate(yearmonthday);
    return 
day;

Reply
#6

Quote:
Originally Posted by Spenker
Посмотреть сообщение
Not work.
pMeanUser = 1467387606;
GetDays(pMeanUser);
Код:
stock GetDays(days)
{
	days = days/60/60/24;
	return days;
}
Reply
#7

pawn Код:
(timestamp - gettime()) / 86400
// or
(timestamp - gettime()) / 60 / 60 / 24
// or
(timestamp - gettime()) / (60 * 60 * 24)
where timestamp is equal to 1467387606. All three of them give 13 days.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)