Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DosTimeToDateTime()

static DateTime System.IO.Compression.ZipHelper.DosTimeToDateTime ( uint dateTime)
inlinestaticpackage

Definition at line 35 of file ZipHelper.cs.

36 {
37 if (dateTime == 0)
38 {
40 }
41 int year = (int)(1980 + (dateTime >> 25));
42 int month = (int)((dateTime >> 21) & 0xF);
43 int day = (int)((dateTime >> 16) & 0x1F);
44 int hour = (int)((dateTime >> 11) & 0x1F);
45 int minute = (int)((dateTime >> 5) & 0x3F);
46 int second = (int)((dateTime & 0x1F) * 2);
47 try
48 {
49 return new DateTime(year, month, day, hour, minute, second, 0);
50 }
51 catch (ArgumentOutOfRangeException)
52 {
54 }
55 catch (ArgumentException)
56 {
58 }
59 }
static readonly DateTime s_invalidDateIndicator
Definition ZipHelper.cs:5

References System.DateTime, System.IO.Compression.ZipHelper.s_invalidDateIndicator, and System.year.

Referenced by System.IO.Compression.ZipArchiveEntry.ZipArchiveEntry().