Click here to Skip to main content
15,916,398 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: a real problem i been facing in release mode Pin
jone201329-Jan-14 21:02
jone201329-Jan-14 21:02 
GeneralRe: a real problem i been facing in release mode Pin
SoMad9-Jan-14 21:08
professionalSoMad9-Jan-14 21:08 
GeneralRe: a real problem i been facing in release mode Pin
jone201329-Jan-14 21:33
jone201329-Jan-14 21:33 
AnswerRe: a real problem i been facing in release mode Pin
Jochen Arndt9-Jan-14 21:08
professionalJochen Arndt9-Jan-14 21:08 
GeneralRe: a real problem i been facing in release mode Pin
jone201329-Jan-14 21:24
jone201329-Jan-14 21:24 
AnswerRe: a real problem i been facing in release mode Pin
Stefan_Lang9-Jan-14 22:34
Stefan_Lang9-Jan-14 22:34 
GeneralRe: a real problem i been facing in release mode Pin
jone2013210-Jan-14 9:43
jone2013210-Jan-14 9:43 
AnswerRe: a real problem i been facing in release mode Pin
Alan Balkany10-Jan-14 5:21
Alan Balkany10-Jan-14 5:21 
GeneralRe: a real problem i been facing in release mode Pin
jone2013214-Jan-14 7:22
jone2013214-Jan-14 7:22 
AnswerRe: a real problem i been facing in release mode Pin
jschell12-Jan-14 9:00
jschell12-Jan-14 9:00 
GeneralRe: a real problem i been facing in release mode Pin
jone2013214-Jan-14 7:25
jone2013214-Jan-14 7:25 
QuestionFile time issue Pin
_Flaviu7-Jan-14 0:55
_Flaviu7-Jan-14 0:55 
AnswerRe: File time issue Pin
Richard MacCutchan7-Jan-14 2:53
mveRichard MacCutchan7-Jan-14 2:53 
AnswerRe: File time issue Pin
Jochen Arndt7-Jan-14 3:02
professionalJochen Arndt7-Jan-14 3:02 
GeneralRe: File time issue Pin
_Flaviu7-Jan-14 21:45
_Flaviu7-Jan-14 21:45 
GeneralRe: File time issue Pin
Richard MacCutchan7-Jan-14 22:06
mveRichard MacCutchan7-Jan-14 22:06 
GeneralRe: File time issue Pin
Jochen Arndt7-Jan-14 22:39
professionalJochen Arndt7-Jan-14 22:39 
GeneralRe: File time issue Pin
_Flaviu8-Jan-14 1:14
_Flaviu8-Jan-14 1:14 
GeneralRe: File time issue Pin
Jochen Arndt8-Jan-14 1:33
professionalJochen Arndt8-Jan-14 1:33 
GeneralRe: File time issue Pin
_Flaviu8-Jan-14 1:44
_Flaviu8-Jan-14 1:44 
GeneralRe: File time issue Pin
Jochen Arndt8-Jan-14 2:13
professionalJochen Arndt8-Jan-14 2:13 
GeneralRe: File time issue [solved] Pin
_Flaviu9-Jan-14 2:11
_Flaviu9-Jan-14 2:11 
I finally made it:
C++
CFileStatus status;
CFile::GetStatus(sPath, status);

SYSTEMTIME systimeFile;
status.m_mtime.GetAsSystemTime(systimeFile);
COleDateTime dt(systimeFile);

if(m_bGreaterThanXP)
{
    TIME_ZONE_INFORMATION tzi;
    DWORD dwTZI = GetTimeZoneInformation(&tzi);
    if(dwTZI == TIME_ZONE_ID_STANDARD || dwTZI == TIME_ZONE_ID_DAYLIGHT)
    {
        SYSTEMTIME stLocal;
        SystemTimeToTzSpecificLocalTime(&tzi, &systimeFile, &stLocal);
        COleDateTime dtLocal(stLocal);
        COleDateTimeSpan span(0, 0, (int)tzi.Bias, 0);
        dt = dtLocal + span;
    }
}

CString sTime = dt.Format(VAR_TIMEVALUEONLY);

where bGreaterThanXP is retrieved like that:
C++
m_bGreaterThanXP = FALSE;

OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
 if(osvi.dwMajorVersion > 5)
     m_bGreaterThanXP = TRUE;

hope to help on somebody ... thank you all !

P.S. Please correct me if I did something wrong.

modified 9-Jan-14 8:28am.

GeneralRe: File time issue [solved] Pin
Jochen Arndt9-Jan-14 3:30
professionalJochen Arndt9-Jan-14 3:30 
QuestionIncrement and Decrement Operators Pin
tgsb6-Jan-14 20:57
tgsb6-Jan-14 20:57 
AnswerRe: Increment and Decrement Operators Pin
Richard MacCutchan6-Jan-14 22:00
mveRichard MacCutchan6-Jan-14 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.