adapters/string_utils.c
/*takes a FILETIME, returns a nice string representation of it*/
takes a FILETIME, returns a nice string representation of it
takes a FILETIME returns a nice string representation of it
char* FILETIME_toAsciiArray(const FILETIME* fileTime)
{
    char* result;
    if (fileTime == NULL)
    {
        LogError("invalid argument const FILETIME* fileTime=%p", fileTime);
        result = NULL;
    }
    else
    {
        FILETIME localFileTime;
        if (FileTimeToLocalFileTime(fileTime, &localFileTime) == 0)
        {
            LogLastError("failure in FileTimeToLocalFileTime");
            result = NULL;
        }
        else
        {
            SYSTEMTIME systemTime;
            if (FileTimeToSystemTime(&localFileTime, &systemTime) == 0)
            {
                LogLastError("failure in FileTimeToLocalFileTime");
                result = NULL;
            }
            else
            {
                char localDate[255];
                if (GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &systemTime, NULL, localDate, sizeof(localDate)/sizeof(localDate[0])) == 0)
                {
                    LogLastError("failure in GetDateFormat");
                    result = NULL;
                }
                else
                {
                    char localTime[255];
                    if (GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systemTime, NULL, localTime, sizeof(localTime)/sizeof(localTime[0])) == 0)
                    {
                        LogLastError("failure in GetTimeFormat");
                        result = NULL;
                    }
                    else
                    {
                        result = sprintf_char("%s %s", localDate, localTime);
                    }
                }
            }
        }
    }
    return result;
}
char * FILETIME_toAsciiArray ( const FILETIME * fileTime ) { char * result ; if ( fileTime == NULL ) { LogError ( " " , fileTime ) ; result = NULL ; } else { FILETIME localFileTime ; if ( FileTimeToLocalFileTime ( fileTime , & localFileTime ) == 0 ) { LogLastError ( " " ) ; result = NULL ; } else { SYSTEMTIME systemTime ; if ( FileTimeToSystemTime ( & localFileTime , & systemTime ) == 0 ) { LogLastError ( " " ) ; result = NULL ; } else { char localDate [ 255 ] ; if ( GetDateFormat ( LOCALE_USER_DEFAULT , DATE_LONGDATE , & systemTime , NULL , localDate , sizeof ( localDate ) / sizeof ( localDate [ 0 ] ) ) == 0 ) { LogLastError ( " " ) ; result = NULL ; } else { char localTime [ 255 ] ; if ( GetTimeFormat ( LOCALE_USER_DEFAULT , 0 , & systemTime , NULL , localTime , sizeof ( localTime ) / sizeof ( localTime [ 0 ] ) ) == 0 ) { LogLastError ( " " ) ; result = NULL ; } else { result = sprintf_char ( " " , localDate , localTime ) ; } } } } } return result ; }
takes a FILETIME, returns a nice string representation of it
takes a FILETIME returns a nice string representation of it
/*return as is*/