The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 FileTimeToSystemTime()

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Mike Buess Posted - 08/11/2002 : 10:59:51 AM
This function apparently return times that are relative to GMT. I live in the Eastern Time zone (w/DST), so file dates returned by the function are exactly 4 hours later than what Windows Explorer tells me. How can I (or any user in an arbitrary time zone) obtain local time from system time? Or from file time directly?

Mike Buess
Origin WebRing Member
2   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 08/11/2002 : 2:13:02 PM
CP, Thanks.

Mike Buess
Origin WebRing Member
cpyang Posted - 08/11/2002 : 2:01:47 PM
We should provide better documentation on that issue, but here is a small program that shows you how,
 

bool show_file_time(LPCSTR lpcsFilename)
{
WIN32_FILE_ATTRIBUTE_DATA fileInfo;

if(GetFileAttributesEx(lpcsFilename, 0, &fileInfo))
{
FILETIME localFiletime;
if(FileTimeToLocalFileTime(&fileInfo.ftLastWriteTime, &localFiletime))
{
SYSTEMTIME sysTime;
if(FileTimeToSystemTime(&localFiletime, &sysTime))
{
printf("%s last modified at %.2d-%.2d-%4d %.2d:%.2d:%.2d\n",
lpcsFilename,
sysTime.wMonth,sysTime.wDay,sysTime.wYear,
sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
return TRUE;
}
}
}
return FALSE;
}

void tt(string strFilename)
{
if(!show_file_time(strFilename))
out_str("error");
}




you can try like

tt %Yfile.ogs

from script window


CP



Edited by - cpyang on 08/11/2002 2:02:20 PM

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000