View Single Post
Author Message
Fastmancz
Senior Member
Join Date: Jul 2013
Location: Czech Republic
Old 12-15-2017 , 18:31   How to convert date to UNIX (timestamp) time?
Reply With Quote #1

Hello,

how do I convert my time format to a Unix timestamp?

PHP Code:
    int timestamp GetTime();
    
char timestamp_porovnam[250], timestamp_porovnam2[250];
    
FormatTime(timestamp_porovnamsizeof(timestamp_porovnam), "%d.%m.%Y %H:%M:%S"timestamp); //Here everything is all right
    
FormatTime(timestamp_porovnam2sizeof(timestamp_porovnam2), "%d.%m.%Y 08:00:00"timestamp); //Here everything is all right
    
int timestamp_porovnam_converted StringToInt(timestamp_porovnam); //I get the value of 16
    
int timestamp_porovnam_converted2 StringToInt(timestamp_porovnam2); //I get the value of 16

    
if(timestamp_porovnam_converted timestamp_porovnam_converted2)
    {
        
PrintToServer("off");
    }
    else
    {
        
PrintToServer("on");
    } 
Thank you for your answers.
__________________


Main owner of the CMGPORTAL.CZ.
---------------------------------------
My plugins:
[CS:GO] Panorama - Timeleft
[CS:GO] JailBreak - Be quiet, please!

Last edited by Fastmancz; 12-16-2017 at 07:27.
Fastmancz is offline