예제 #1
0
 // Token: 0x06000515 RID: 1301 RVA: 0x000128B4 File Offset: 0x00010AB4
 public static System.Runtime.InteropServices.ComTypes.FILETIME DateTimeToFileTime(DateTime datetime)
 {
     Win32api.SYSTEMTIME systemtime = default(Win32api.SYSTEMTIME);
     systemtime.Year         = (short)datetime.Year;
     systemtime.Month        = (short)datetime.Month;
     systemtime.Day          = (short)datetime.Day;
     systemtime.Hour         = (short)datetime.Hour;
     systemtime.Minute       = (short)datetime.Minute;
     systemtime.Second       = (short)datetime.Second;
     systemtime.Milliseconds = (short)datetime.Millisecond;
     System.Runtime.InteropServices.ComTypes.FILETIME result;
     Win32api.SystemTimeToFileTime(ref systemtime, out result);
     return(result);
 }
예제 #2
0
        // Token: 0x06000513 RID: 1299 RVA: 0x00012840 File Offset: 0x00010A40
        public static DateTime FileTimeToDateTime(System.Runtime.InteropServices.ComTypes.FILETIME filetime)
        {
            Win32api.SYSTEMTIME systemtime = default(Win32api.SYSTEMTIME);
            Win32api.FileTimeToSystemTime(ref filetime, ref systemtime);
            DateTime result;

            try
            {
                result = new DateTime((int)systemtime.Year, (int)systemtime.Month, (int)systemtime.Day, (int)systemtime.Hour, (int)systemtime.Minute, (int)systemtime.Second, (int)systemtime.Milliseconds);
            }
            catch (Exception)
            {
                result = DateTime.Now;
            }
            return(result);
        }
예제 #3
0
 private static extern bool SystemTimeToFileTime([In] ref Win32api.SYSTEMTIME lpSystemTime, out System.Runtime.InteropServices.ComTypes.FILETIME lpFileTime);
예제 #4
0
 private static extern bool FileTimeToSystemTime(ref System.Runtime.InteropServices.ComTypes.FILETIME FileTime, ref Win32api.SYSTEMTIME SystemTime);