View Single Post
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 03-19-2019 , 10:01   Re: Help with plugin not using correct time
Reply With Quote #3

PHP Code:
// Generates GMT Date and compensates for timezones
char GetGmtDate()
{
    
int timestamp GetTime();
    
    
// Fix timezones
    
char offsetstr[10];
    
FormatTime(offsetstrsizeof(offsetstr), "%z"timestamp);
    
timestamp -= (StringToInt(offsetstr) / 100) * 3600;
    
    
// Build sring
    
char GMTTime[40];
    
FormatTime(GMTTimesizeof(GMTTime), "%a, %d %h %Y %H:%M:%S GMT"timestamp);
    
    return 
GMTTime;


Last edited by lugui; 03-19-2019 at 10:02.
lugui is offline