Quote:
Originally Posted by Bugsy
Does this help?
PHP Code:
#include <amxmodx>
public plugin_init() { new const FutureDate[] = "14:00:00 06/25/2021"; new iFutureDateTime = parse_time( FutureDate , "%H:%M:%S %m/%d/%Y" ); new iCurrentDateTime = get_systime(); new iTimeDifference = iFutureDateTime - iCurrentDateTime; new iDays , iHours , iMinutes, iSeconds; convert_seconds( iTimeDifference , iSeconds , iMinutes , iHours , iDays ); server_print( "%s is %d days, %d hours, %d minutes, %d seconds away" , FutureDate , iDays , iHours , iMinutes , iSeconds ); }
convert_seconds( iTotalSeconds , &seconds , &minutes , &hours , &days ) { days = iTotalSeconds / 86400; hours = ( iTotalSeconds / 3600 ) % 24; minutes = ( iTotalSeconds / 60 ) % 60; seconds = iTotalSeconds % 60; }
|
In a way yes, I think I'll have to create an array with all the "Saturdays" of the year to be able to save the parse_time automatically since the event will always recur on the same day and time.
Edit: And that made me have an idea of what to do, I will use part of my stock with part of yours, so I take how many days are left until the required date, and I use parse_time, thanks.
__________________