General Support

{ Ask } Question ?
{ FAQ } Help !
{ Video } Tutorials
{ Knowledge } Base

OVH Basement Class Reference

{ ./Basement.cpp }
{ /includes/[Confg & Functions].cpp }

Modules Reference

{ /modules/VirtualHost }
{ /modules/wwwFolderStructure }
{ /modules/wwwPHPPreset }
{ /modules/wwwHTMLPreset }
{ /modules/wwwCSSPreset }
{ /modules/wwwJSPreset }
{ /modules/backupFolderStructure }
reference > includes > Functions.cpp

      
#include 
#include "Functions.h"

char* Functions::NOW()
{
    time_t now = time(0); // --- current date/time based on current system
    char* dt = ctime(&now); // --- convert now to string form
    
    return dt;
}

char* Functions::NOW_UTC()
{
    time_t now = time(0); // --- current date/time based on current system
    
    tm *gmtm = gmtime(&now); // --- convert now to tm struct for UTC
    char* dt = asctime(gmtm);
    
    return dt;
}

std::string Functions::trimStr(std::string s)
{
    std::string t = "";
    unsigned int i;
    for (i=0; i < s.length(); i++){ if (!isspace(s[i]))t += s[i];}
    return t;
}