---
title: "delphi 获取文件夹时间"
author: "woxiaoe"
date: "2011-03-03T11:29:05Z"
tags: []
categories: ["编程语言"]
slug: "delphi"
draft: false
lastmod: "2011-03-03T11:29:05Z"
id: 939306
url: "https://ideasforjava.iteye.com/blog/939306"
---

```
var 
    data:   WIN32_FILE_ATTRIBUTE_DATA; 
    systime:   SYSTEMTIME; 
    local:   FILETIME; 
begin 
    if(not   GetFileAttributesEx( 'C:\新建文件夹 ',   GetFileExInfoStandard,   @data))   then 
        RaiseLastWin32Error(); 
    FileTimeToLocalFileTime(data.ftCreationTime,   local);   //要转换为本地时间，否则为标准时间 
    FileTimeToSystemTime(local,   systime); 
    with   systime   do 
        ShowMessage(Format( '%d-%d-%d   %d:%d:%d ',   [wYear,   wMonth,   wDay,   wHour,   wMinute,   wSecond])); 
end; 
```