Changeset 82 for Include/Classes/System/DateTime.ab
- Timestamp:
- Feb 1, 2007, 7:35:43 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/DateTime.ab
r81 r82 385 385 Static Function FromFileTime(fileTime As FILETIME) As DateTime 386 386 Dim localTime As FILETIME 387 Dim time As SYSTEMTIME 387 388 FileTimeToLocalFileTime(fileTime, localTime) 388 Dim time As SYSTEMTIME389 389 FileTimeToSystemTime(localTime, time) 390 390 391 Dim date As DateTime(time, Local) 391 392 Return date … … 397 398 .wYear = Year As Word 398 399 .wMonth = Month As Word 400 .wDayOfWeek = DayOfWeek As Word 399 401 .wDay = Day As Word 400 402 .wHour = Hour As Word … … 411 413 Dim time As SYSTEMTIME 412 414 FileTimeToSystemTime(fileTime, time) 415 413 416 Dim date As DateTime(time, Utc) 414 417 Return date … … 418 421 Dim fileTime As FILETIME 419 422 fileTime = ToFileTime() 420 If Kind = 1 Then 421 Dim utcTime As FILETIME 422 LocalFileTimeToFileTime(fileTime, ToFileTimeUtc)'Return 423 Else 424 Return fileTime 423 If Kind = Utc Then 424 ToFileTimeUtc = fileTime 425 Else 426 LocalFileTimeToFileTime(fileTime, ToFileTimeUtc) 'Return 425 427 End If 426 428 End Function 427 429 428 430 Function ToLocalTime() As DateTime 431 If Kind = Local Then 432 ToLocalTime = This 433 Else 434 ToLocalTime = DateTime.FromFileTime(ToFileTime()) 435 ToLocalTime.Kind = Local 436 End If 437 End Function 438 439 Function ToUniversalTime() As DateTime 429 440 If Kind = Utc Then 430 ToLocalTime = DateTime.FromFileTime(ToFileTimeUtc()) 431 ToLocalTime.Kind = Local 432 Else 433 ToLocalTime = This 434 End If 435 End Function 436 437 Function ToUniversalTime() As DateTime 438 If Kind = Local Then 441 ToUniversalTime = This 442 Else 439 443 ToUniversalTime = DateTime.FromFileTimeUtc(ToFileTimeUtc()) 440 444 ToUniversalTime.Kind = Utc 441 Else442 ToUniversalTime = This443 445 End If 444 446 End Function
Note:
See TracChangeset
for help on using the changeset viewer.