diff --git a/DiscImageChef.Decoders/SCSI/Modes/3C_HP.cs b/DiscImageChef.Decoders/SCSI/Modes/3C_HP.cs index 5bf307ead..99d98b57e 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/3C_HP.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/3C_HP.cs @@ -121,7 +121,7 @@ namespace DiscImageChef.Decoders.SCSI if(page.WT) { - sb.AppendFormat("\tDrive's date/time is: {0}", DateHandlers.UNIXUnsignedToDateTime(page.WorldTime)) + sb.AppendFormat("\tDrive's date/time is: {0}", DateHandlers.UnixUnsignedToDateTime(page.WorldTime)) .AppendLine(); if(page.UTC) sb.AppendLine("\tDrive's time is UTC"); if(page.NTP) sb.AppendLine("\tDrive's time is synchronized with a NTP source"); diff --git a/DiscImageChef.DiscImages/CopyQM.cs b/DiscImageChef.DiscImages/CopyQM.cs index 3079a0ea1..e42d15cab 100644 --- a/DiscImageChef.DiscImages/CopyQM.cs +++ b/DiscImageChef.DiscImages/CopyQM.cs @@ -325,7 +325,7 @@ namespace DiscImageChef.DiscImages calculatedDataCrc == header.crc); ImageInfo.ImageApplication = "CopyQM"; - ImageInfo.ImageCreationTime = DateHandlers.DOSToDateTime(header.date, header.time); + ImageInfo.ImageCreationTime = DateHandlers.DosToDateTime(header.date, header.time); ImageInfo.ImageLastModificationTime = ImageInfo.ImageCreationTime; ImageInfo.ImageName = header.volumeLabel; ImageInfo.ImageSize = (ulong)(stream.Length - 133 - header.commentLength); diff --git a/DiscImageChef.DiscImages/QCOW.cs b/DiscImageChef.DiscImages/QCOW.cs index 569c67d66..28e087b87 100644 --- a/DiscImageChef.DiscImages/QCOW.cs +++ b/DiscImageChef.DiscImages/QCOW.cs @@ -281,7 +281,7 @@ namespace DiscImageChef.DiscImages clusterCache = new Dictionary(); ImageInfo.ImageCreationTime = imageFilter.GetCreationTime(); - ImageInfo.ImageLastModificationTime = qHdr.mtime > 0 ? DateHandlers.UNIXUnsignedToDateTime(qHdr.mtime) : imageFilter.GetLastWriteTime(); + ImageInfo.ImageLastModificationTime = qHdr.mtime > 0 ? DateHandlers.UnixUnsignedToDateTime(qHdr.mtime) : imageFilter.GetLastWriteTime(); ImageInfo.ImageName = Path.GetFileNameWithoutExtension(imageFilter.GetFilename()); ImageInfo.Sectors = qHdr.size / 512; ImageInfo.SectorSize = 512; diff --git a/DiscImageChef.DiscImages/SuperCardPro.cs b/DiscImageChef.DiscImages/SuperCardPro.cs index aa4a93ba8..7563b5f89 100644 --- a/DiscImageChef.DiscImages/SuperCardPro.cs +++ b/DiscImageChef.DiscImages/SuperCardPro.cs @@ -369,9 +369,9 @@ namespace DiscImageChef.DiscImages DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageComments = \"{0}\"", ImageInfo.ImageComments); - ImageInfo.ImageCreationTime = footer.creationTime != 0 ? DateHandlers.UNIXToDateTime(footer.creationTime) : imageFilter.GetCreationTime(); + ImageInfo.ImageCreationTime = footer.creationTime != 0 ? DateHandlers.UnixToDateTime(footer.creationTime) : imageFilter.GetCreationTime(); - ImageInfo.ImageLastModificationTime = footer.modificationTime != 0 ? DateHandlers.UNIXToDateTime(footer.modificationTime) : imageFilter.GetLastWriteTime(); + ImageInfo.ImageLastModificationTime = footer.modificationTime != 0 ? DateHandlers.UnixToDateTime(footer.modificationTime) : imageFilter.GetLastWriteTime(); DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageCreationTime = {0}", ImageInfo.ImageCreationTime); diff --git a/DiscImageChef.Filesystems/CPM/File.cs b/DiscImageChef.Filesystems/CPM/File.cs index d0d1cbfd7..24f67f25b 100644 --- a/DiscImageChef.Filesystems/CPM/File.cs +++ b/DiscImageChef.Filesystems/CPM/File.cs @@ -105,8 +105,8 @@ namespace DiscImageChef.Filesystems.CPM if(string.IsNullOrEmpty(path) || string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) == 0) { - if(labelCreationDate != null) stat.CreationTime = DateHandlers.CPMToDateTime(labelCreationDate); - if(labelUpdateDate != null) stat.StatusChangeTime = DateHandlers.CPMToDateTime(labelUpdateDate); + if(labelCreationDate != null) stat.CreationTime = DateHandlers.CpmToDateTime(labelCreationDate); + if(labelUpdateDate != null) stat.StatusChangeTime = DateHandlers.CpmToDateTime(labelUpdateDate); stat.Attributes = FileAttributes.Directory; stat.BlockSize = XmlFsType.ClusterSize; return Errno.NoError; diff --git a/DiscImageChef.Filesystems/CPM/Info.cs b/DiscImageChef.Filesystems/CPM/Info.cs index e730c69c5..dba491f94 100644 --- a/DiscImageChef.Filesystems/CPM/Info.cs +++ b/DiscImageChef.Filesystems/CPM/Info.cs @@ -1038,9 +1038,9 @@ namespace DiscImageChef.Filesystems.CPM if(thirdPartyTimestamps) sb.AppendLine("Volume uses third party timestamps"); if(labelCreationDate != null) - sb.AppendFormat("Volume created on {0}", DateHandlers.CPMToDateTime(labelCreationDate)).AppendLine(); + sb.AppendFormat("Volume created on {0}", DateHandlers.CpmToDateTime(labelCreationDate)).AppendLine(); if(labelUpdateDate != null) - sb.AppendFormat("Volume updated on {0}", DateHandlers.CPMToDateTime(labelUpdateDate)).AppendLine(); + sb.AppendFormat("Volume updated on {0}", DateHandlers.CpmToDateTime(labelUpdateDate)).AppendLine(); XmlFsType = new FileSystemType(); XmlFsType.Bootable |= workingDefinition.sofs > 0 || workingDefinition.ofs > 0; @@ -1049,12 +1049,12 @@ namespace DiscImageChef.Filesystems.CPM else XmlFsType.Clusters = (long)(partition.End - partition.Start); if(labelCreationDate != null) { - XmlFsType.CreationDate = DateHandlers.CPMToDateTime(labelCreationDate); + XmlFsType.CreationDate = DateHandlers.CpmToDateTime(labelCreationDate); XmlFsType.CreationDateSpecified = true; } if(labelUpdateDate != null) { - XmlFsType.ModificationDate = DateHandlers.CPMToDateTime(labelUpdateDate); + XmlFsType.ModificationDate = DateHandlers.CpmToDateTime(labelUpdateDate); XmlFsType.ModificationDateSpecified = true; } XmlFsType.Type = "CP/M"; diff --git a/DiscImageChef.Filesystems/CPM/Super.cs b/DiscImageChef.Filesystems/CPM/Super.cs index 652989024..be6f8ab93 100644 --- a/DiscImageChef.Filesystems/CPM/Super.cs +++ b/DiscImageChef.Filesystems/CPM/Super.cs @@ -484,10 +484,10 @@ namespace DiscImageChef.Filesystems.CPM if(statCache.TryGetValue(file1, out fInfo)) statCache.Remove(file1); else fInfo = new FileEntryInfo(); - if(atime) fInfo.AccessTime = DateHandlers.CPMToDateTime(dateEntry.date1); - else fInfo.CreationTime = DateHandlers.CPMToDateTime(dateEntry.date1); + if(atime) fInfo.AccessTime = DateHandlers.CpmToDateTime(dateEntry.date1); + else fInfo.CreationTime = DateHandlers.CpmToDateTime(dateEntry.date1); - fInfo.LastWriteTime = DateHandlers.CPMToDateTime(dateEntry.date2); + fInfo.LastWriteTime = DateHandlers.CpmToDateTime(dateEntry.date2); statCache.Add(file1, fInfo); } @@ -497,10 +497,10 @@ namespace DiscImageChef.Filesystems.CPM if(statCache.TryGetValue(file2, out fInfo)) statCache.Remove(file2); else fInfo = new FileEntryInfo(); - if(atime) fInfo.AccessTime = DateHandlers.CPMToDateTime(dateEntry.date3); - else fInfo.CreationTime = DateHandlers.CPMToDateTime(dateEntry.date3); + if(atime) fInfo.AccessTime = DateHandlers.CpmToDateTime(dateEntry.date3); + else fInfo.CreationTime = DateHandlers.CpmToDateTime(dateEntry.date3); - fInfo.LastWriteTime = DateHandlers.CPMToDateTime(dateEntry.date4); + fInfo.LastWriteTime = DateHandlers.CpmToDateTime(dateEntry.date4); statCache.Add(file2, fInfo); } @@ -510,10 +510,10 @@ namespace DiscImageChef.Filesystems.CPM if(statCache.TryGetValue(file3, out fInfo)) statCache.Remove(file3); else fInfo = new FileEntryInfo(); - if(atime) fInfo.AccessTime = DateHandlers.CPMToDateTime(dateEntry.date5); - else fInfo.CreationTime = DateHandlers.CPMToDateTime(dateEntry.date5); + if(atime) fInfo.AccessTime = DateHandlers.CpmToDateTime(dateEntry.date5); + else fInfo.CreationTime = DateHandlers.CpmToDateTime(dateEntry.date5); - fInfo.LastWriteTime = DateHandlers.CPMToDateTime(dateEntry.date6); + fInfo.LastWriteTime = DateHandlers.CpmToDateTime(dateEntry.date6); statCache.Add(file3, fInfo); } @@ -543,9 +543,9 @@ namespace DiscImageChef.Filesystems.CPM ctime[0] = trdPartyDateEntry.create1[0]; ctime[1] = trdPartyDateEntry.create1[1]; - fInfo.AccessTime = DateHandlers.CPMToDateTime(trdPartyDateEntry.access1); - fInfo.CreationTime = DateHandlers.CPMToDateTime(ctime); - fInfo.LastWriteTime = DateHandlers.CPMToDateTime(trdPartyDateEntry.modify1); + fInfo.AccessTime = DateHandlers.CpmToDateTime(trdPartyDateEntry.access1); + fInfo.CreationTime = DateHandlers.CpmToDateTime(ctime); + fInfo.LastWriteTime = DateHandlers.CpmToDateTime(trdPartyDateEntry.modify1); statCache.Add(file1, fInfo); } @@ -559,9 +559,9 @@ namespace DiscImageChef.Filesystems.CPM ctime[0] = trdPartyDateEntry.create2[0]; ctime[1] = trdPartyDateEntry.create2[1]; - fInfo.AccessTime = DateHandlers.CPMToDateTime(trdPartyDateEntry.access2); - fInfo.CreationTime = DateHandlers.CPMToDateTime(ctime); - fInfo.LastWriteTime = DateHandlers.CPMToDateTime(trdPartyDateEntry.modify2); + fInfo.AccessTime = DateHandlers.CpmToDateTime(trdPartyDateEntry.access2); + fInfo.CreationTime = DateHandlers.CpmToDateTime(ctime); + fInfo.LastWriteTime = DateHandlers.CpmToDateTime(trdPartyDateEntry.modify2); statCache.Add(file2, fInfo); } @@ -575,9 +575,9 @@ namespace DiscImageChef.Filesystems.CPM ctime[0] = trdPartyDateEntry.create3[0]; ctime[1] = trdPartyDateEntry.create3[1]; - fInfo.AccessTime = DateHandlers.CPMToDateTime(trdPartyDateEntry.access3); - fInfo.CreationTime = DateHandlers.CPMToDateTime(ctime); - fInfo.LastWriteTime = DateHandlers.CPMToDateTime(trdPartyDateEntry.modify3); + fInfo.AccessTime = DateHandlers.CpmToDateTime(trdPartyDateEntry.access3); + fInfo.CreationTime = DateHandlers.CpmToDateTime(ctime); + fInfo.LastWriteTime = DateHandlers.CpmToDateTime(trdPartyDateEntry.modify3); statCache.Add(file3, fInfo); } @@ -660,12 +660,12 @@ namespace DiscImageChef.Filesystems.CPM }; if(labelCreationDate != null) { - XmlFsType.CreationDate = DateHandlers.CPMToDateTime(labelCreationDate); + XmlFsType.CreationDate = DateHandlers.CpmToDateTime(labelCreationDate); XmlFsType.CreationDateSpecified = true; } if(labelUpdateDate != null) { - XmlFsType.ModificationDate = DateHandlers.CPMToDateTime(labelUpdateDate); + XmlFsType.ModificationDate = DateHandlers.CpmToDateTime(labelUpdateDate); XmlFsType.ModificationDateSpecified = true; } if(!string.IsNullOrEmpty(label)) XmlFsType.VolumeName = label; diff --git a/DiscImageChef.Filesystems/EFS.cs b/DiscImageChef.Filesystems/EFS.cs index 451c55bab..408c988b0 100644 --- a/DiscImageChef.Filesystems/EFS.cs +++ b/DiscImageChef.Filesystems/EFS.cs @@ -216,7 +216,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("{0} sectors per track", efsSb.sb_sectors).AppendLine(); sb.AppendFormat("{0} heads per cylinder", efsSb.sb_heads).AppendLine(); sb.AppendFormat("{0} cylinder groups", efsSb.sb_ncg).AppendLine(); - sb.AppendFormat("Volume created on {0}", DateHandlers.UNIXToDateTime(efsSb.sb_time)).AppendLine(); + sb.AppendFormat("Volume created on {0}", DateHandlers.UnixToDateTime(efsSb.sb_time)).AppendLine(); sb.AppendFormat("{0} bytes on bitmap", efsSb.sb_bmsize).AppendLine(); sb.AppendFormat("{0} free blocks", efsSb.sb_tfree).AppendLine(); sb.AppendFormat("{0} free inodes", efsSb.sb_tinode).AppendLine(); @@ -241,7 +241,7 @@ namespace DiscImageChef.Filesystems Dirty = efsSb.sb_dirty > 0, VolumeName = StringHandlers.CToString(efsSb.sb_fname, CurrentEncoding), VolumeSerial = $"{efsSb.sb_checksum:X8}", - CreationDate = DateHandlers.UNIXToDateTime(efsSb.sb_time), + CreationDate = DateHandlers.UnixToDateTime(efsSb.sb_time), CreationDateSpecified = true }; } diff --git a/DiscImageChef.Filesystems/FAT.cs b/DiscImageChef.Filesystems/FAT.cs index 1c824f2a2..c87bc598f 100644 --- a/DiscImageChef.Filesystems/FAT.cs +++ b/DiscImageChef.Filesystems/FAT.cs @@ -1333,7 +1333,7 @@ namespace DiscImageChef.Filesystems if(entry.ctime > 0 && entry.cdate > 0) { - XmlFsType.CreationDate = DateHandlers.DOSToDateTime(entry.cdate, entry.ctime); + XmlFsType.CreationDate = DateHandlers.DosToDateTime(entry.cdate, entry.ctime); if(entry.ctime_ms > 0) XmlFsType.CreationDate = XmlFsType.CreationDate.AddMilliseconds(entry.ctime_ms * 10); XmlFsType.CreationDateSpecified = true; sb.AppendFormat("Volume created on {0}", XmlFsType.CreationDate).AppendLine(); @@ -1341,13 +1341,13 @@ namespace DiscImageChef.Filesystems if(entry.mtime > 0 && entry.mdate > 0) { - XmlFsType.ModificationDate = DateHandlers.DOSToDateTime(entry.mdate, entry.mtime); + XmlFsType.ModificationDate = DateHandlers.DosToDateTime(entry.mdate, entry.mtime); XmlFsType.ModificationDateSpecified = true; sb.AppendFormat("Volume last modified on {0}", XmlFsType.ModificationDate).AppendLine(); } if(entry.adate > 0) - sb.AppendFormat("Volume last accessed on {0:d}", DateHandlers.DOSToDateTime(entry.adate, 0)) + sb.AppendFormat("Volume last accessed on {0:d}", DateHandlers.DosToDateTime(entry.adate, 0)) .AppendLine(); break; diff --git a/DiscImageChef.Filesystems/FFS.cs b/DiscImageChef.Filesystems/FFS.cs index 6bd72ffb3..fb2fee47a 100644 --- a/DiscImageChef.Filesystems/FFS.cs +++ b/DiscImageChef.Filesystems/FFS.cs @@ -265,7 +265,7 @@ namespace DiscImageChef.Filesystems } if((ufs_sb.fs_maxfilesize & 0xFFFFFFFF) > SunOSEpoch && - DateHandlers.UNIXUnsignedToDateTime(ufs_sb.fs_maxfilesize & 0xFFFFFFFF) < DateTime.Now) + DateHandlers.UnixUnsignedToDateTime(ufs_sb.fs_maxfilesize & 0xFFFFFFFF) < DateTime.Now) { fs_type_42bsd = false; fs_type_sun = true; @@ -273,7 +273,7 @@ namespace DiscImageChef.Filesystems } // This is for sure, as it is shared with a sectors/track with non-x86 SunOS, Epoch is absurdly high for that - if(ufs_sb.fs_old_npsect > SunOSEpoch && DateHandlers.UNIXToDateTime(ufs_sb.fs_old_npsect) < DateTime.Now + if(ufs_sb.fs_old_npsect > SunOSEpoch && DateHandlers.UnixToDateTime(ufs_sb.fs_old_npsect) < DateTime.Now ) { fs_type_42bsd = false; @@ -319,9 +319,9 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("inode-block LBA: {0}", ufs_sb.fs_iblkno).AppendLine(); sbInformation.AppendFormat("First data block LBA: {0}", ufs_sb.fs_dblkno).AppendLine(); sbInformation.AppendFormat("Cylinder group offset in cylinder: {0}", ufs_sb.fs_old_cgoffset).AppendLine(); - sbInformation.AppendFormat("Volume last written on {0}", DateHandlers.UNIXToDateTime(ufs_sb.fs_old_time)) + sbInformation.AppendFormat("Volume last written on {0}", DateHandlers.UnixToDateTime(ufs_sb.fs_old_time)) .AppendLine(); - XmlFsType.ModificationDate = DateHandlers.UNIXToDateTime(ufs_sb.fs_old_time); + XmlFsType.ModificationDate = DateHandlers.UnixToDateTime(ufs_sb.fs_old_time); XmlFsType.ModificationDateSpecified = true; sbInformation.AppendFormat("{0} blocks in volume ({1} bytes)", ufs_sb.fs_old_size, (long)ufs_sb.fs_old_size * ufs_sb.fs_fsize).AppendLine(); @@ -358,7 +358,7 @@ namespace DiscImageChef.Filesystems if(fs_type_sun) sbInformation.AppendFormat("{0} sectors/track", ufs_sb.fs_old_npsect).AppendLine(); else if(fs_type_sun86) - sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UNIXToDateTime(ufs_sb.fs_old_npsect)) + sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UnixToDateTime(ufs_sb.fs_old_npsect)) .AppendLine(); sbInformation.AppendFormat("Hardware sector interleave: {0}", ufs_sb.fs_old_interleave).AppendLine(); sbInformation.AppendFormat("Sector 0 skew: {0}/track", ufs_sb.fs_old_trackskew).AppendLine(); @@ -416,9 +416,9 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("{0} free inodes", ufs_sb.fs_cstotal.cs_nifree).AppendLine(); sbInformation.AppendFormat("{0} free frags", ufs_sb.fs_cstotal.cs_nffree).AppendLine(); sbInformation.AppendFormat("{0} free clusters", ufs_sb.fs_cstotal.cs_numclusters).AppendLine(); - sbInformation.AppendFormat("Volume last written on {0}", DateHandlers.UNIXToDateTime(ufs_sb.fs_time)) + sbInformation.AppendFormat("Volume last written on {0}", DateHandlers.UnixToDateTime(ufs_sb.fs_time)) .AppendLine(); - XmlFsType.ModificationDate = DateHandlers.UNIXToDateTime(ufs_sb.fs_time); + XmlFsType.ModificationDate = DateHandlers.UnixToDateTime(ufs_sb.fs_time); XmlFsType.ModificationDateSpecified = true; sbInformation.AppendFormat("{0} blocks ({1} bytes)", ufs_sb.fs_size, ufs_sb.fs_size * ufs_sb.fs_fsize) .AppendLine(); @@ -431,7 +431,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("{0} inodes pending of being freed", ufs_sb.fs_pendinginodes).AppendLine(); } if(fs_type_sun) - sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UNIXToDateTime(ufs_sb.fs_old_npsect)) + sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UnixToDateTime(ufs_sb.fs_old_npsect)) .AppendLine(); else if(fs_type_sun86) sbInformation.AppendFormat("{0} sectors/track", ufs_sb.fs_state).AppendLine(); else if(fs_type_44bsd) @@ -440,7 +440,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("Maximum length of a symbolic link: {0}", ufs_sb.fs_maxsymlinklen) .AppendLine(); sbInformation.AppendFormat("A file can be {0} bytes at max", ufs_sb.fs_maxfilesize).AppendLine(); - sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UNIXToDateTime(ufs_sb.fs_state)) + sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UnixToDateTime(ufs_sb.fs_state)) .AppendLine(); } if(ufs_sb.fs_old_nrpos > 0) diff --git a/DiscImageChef.Filesystems/HPFS.cs b/DiscImageChef.Filesystems/HPFS.cs index f23c6143b..b74aa1d0f 100644 --- a/DiscImageChef.Filesystems/HPFS.cs +++ b/DiscImageChef.Filesystems/HPFS.cs @@ -142,8 +142,8 @@ namespace DiscImageChef.Filesystems .AppendLine(); // sb.AppendFormat("Filesystem type: \"{0}\"", hpfs_bpb.fs_type).AppendLine(); - DateTime lastChk = DateHandlers.UNIXToDateTime(hpfsSb.last_chkdsk); - DateTime lastOptim = DateHandlers.UNIXToDateTime(hpfsSb.last_optim); + DateTime lastChk = DateHandlers.UnixToDateTime(hpfsSb.last_chkdsk); + DateTime lastOptim = DateHandlers.UnixToDateTime(hpfsSb.last_optim); sb.AppendFormat("HPFS version: {0}", hpfsSb.version).AppendLine(); sb.AppendFormat("Functional version: {0}", hpfsSb.func_version).AppendLine(); diff --git a/DiscImageChef.Filesystems/ISO9660/Structs/ISO.cs b/DiscImageChef.Filesystems/ISO9660/Structs/ISO.cs index 238fd1ad6..c1a3bf543 100644 --- a/DiscImageChef.Filesystems/ISO9660/Structs/ISO.cs +++ b/DiscImageChef.Filesystems/ISO9660/Structs/ISO.cs @@ -180,27 +180,27 @@ namespace DiscImageChef.Filesystems.ISO9660 if(pvd.creation_date[0] == '0' || pvd.creation_date[0] == 0x00) decodedVD.CreationTime = DateTime.MinValue; - else decodedVD.CreationTime = DateHandlers.ISO9660ToDateTime(pvd.creation_date); + else decodedVD.CreationTime = DateHandlers.Iso9660ToDateTime(pvd.creation_date); if(pvd.modification_date[0] == '0' || pvd.modification_date[0] == 0x00) decodedVD.HasModificationTime = false; else { decodedVD.HasModificationTime = true; - decodedVD.ModificationTime = DateHandlers.ISO9660ToDateTime(pvd.modification_date); + decodedVD.ModificationTime = DateHandlers.Iso9660ToDateTime(pvd.modification_date); } if(pvd.expiration_date[0] == '0' || pvd.expiration_date[0] == 0x00) decodedVD.HasExpirationTime = false; else { decodedVD.HasExpirationTime = true; - decodedVD.ExpirationTime = DateHandlers.ISO9660ToDateTime(pvd.expiration_date); + decodedVD.ExpirationTime = DateHandlers.Iso9660ToDateTime(pvd.expiration_date); } if(pvd.effective_date[0] == '0' || pvd.effective_date[0] == 0x00) decodedVD.HasEffectiveTime = false; else { decodedVD.HasEffectiveTime = true; - decodedVD.EffectiveTime = DateHandlers.ISO9660ToDateTime(pvd.effective_date); + decodedVD.EffectiveTime = DateHandlers.Iso9660ToDateTime(pvd.effective_date); } decodedVD.Blocks = pvd.volume_space_size; diff --git a/DiscImageChef.Filesystems/ISO9660/Structs/Joliet.cs b/DiscImageChef.Filesystems/ISO9660/Structs/Joliet.cs index ed5513d51..987828144 100644 --- a/DiscImageChef.Filesystems/ISO9660/Structs/Joliet.cs +++ b/DiscImageChef.Filesystems/ISO9660/Structs/Joliet.cs @@ -55,27 +55,27 @@ namespace DiscImageChef.Filesystems.ISO9660 if(jolietvd.creation_date[0] < 0x31 || jolietvd.creation_date[0] > 0x39) decodedVD.CreationTime = DateTime.MinValue; - else decodedVD.CreationTime = DateHandlers.ISO9660ToDateTime(jolietvd.creation_date); + else decodedVD.CreationTime = DateHandlers.Iso9660ToDateTime(jolietvd.creation_date); if(jolietvd.modification_date[0] < 0x31 || jolietvd.modification_date[0] > 0x39) decodedVD.HasModificationTime = false; else { decodedVD.HasModificationTime = true; - decodedVD.ModificationTime = DateHandlers.ISO9660ToDateTime(jolietvd.modification_date); + decodedVD.ModificationTime = DateHandlers.Iso9660ToDateTime(jolietvd.modification_date); } if(jolietvd.expiration_date[0] < 0x31 || jolietvd.expiration_date[0] > 0x39) decodedVD.HasExpirationTime = false; else { decodedVD.HasExpirationTime = true; - decodedVD.ExpirationTime = DateHandlers.ISO9660ToDateTime(jolietvd.expiration_date); + decodedVD.ExpirationTime = DateHandlers.Iso9660ToDateTime(jolietvd.expiration_date); } if(jolietvd.effective_date[0] < 0x31 || jolietvd.effective_date[0] > 0x39) decodedVD.HasEffectiveTime = false; else { decodedVD.HasEffectiveTime = true; - decodedVD.EffectiveTime = DateHandlers.ISO9660ToDateTime(jolietvd.effective_date); + decodedVD.EffectiveTime = DateHandlers.Iso9660ToDateTime(jolietvd.effective_date); } decodedVD.Blocks = jolietvd.volume_space_size; diff --git a/DiscImageChef.Filesystems/JFS.cs b/DiscImageChef.Filesystems/JFS.cs index 700576e84..3c266328c 100644 --- a/DiscImageChef.Filesystems/JFS.cs +++ b/DiscImageChef.Filesystems/JFS.cs @@ -219,7 +219,7 @@ namespace DiscImageChef.Filesystems if(jfsSb.s_flags.HasFlag(JFS_Flags.AIX)) sb.AppendLine("Volume supports AIX"); if(jfsSb.s_state != 0) sb.AppendLine("Volume is dirty"); sb.AppendFormat("Volume was last updated on {0}", - DateHandlers.UNIXUnsignedToDateTime(jfsSb.s_time.tv_sec, jfsSb.s_time.tv_nsec)) + DateHandlers.UnixUnsignedToDateTime(jfsSb.s_time.tv_sec, jfsSb.s_time.tv_nsec)) .AppendLine(); if(jfsSb.s_version == 1) sb.AppendFormat("Volume name: {0}", CurrentEncoding.GetString(jfsSb.s_fpack)).AppendLine(); @@ -234,7 +234,7 @@ namespace DiscImageChef.Filesystems Bootable = true, VolumeName = CurrentEncoding.GetString(jfsSb.s_version == 1 ? jfsSb.s_fpack : jfsSb.s_label), VolumeSerial = $"{jfsSb.s_uuid}", - ModificationDate = DateHandlers.UNIXUnsignedToDateTime(jfsSb.s_time.tv_sec, jfsSb.s_time.tv_nsec), + ModificationDate = DateHandlers.UnixUnsignedToDateTime(jfsSb.s_time.tv_sec, jfsSb.s_time.tv_nsec), ModificationDateSpecified = true }; if(jfsSb.s_state != 0) XmlFsType.Dirty = true; diff --git a/DiscImageChef.Filesystems/Locus.cs b/DiscImageChef.Filesystems/Locus.cs index 5df1b3ef4..034912a76 100644 --- a/DiscImageChef.Filesystems/Locus.cs +++ b/DiscImageChef.Filesystems/Locus.cs @@ -314,7 +314,7 @@ namespace DiscImageChef.Filesystems DicConsole.DebugWriteLine("Locus plugin", "LocusSb.s_fmod = {0}", LocusSb.s_fmod); DicConsole.DebugWriteLine("Locus plugin", "LocusSb.s_version = {0}", LocusSb.s_version); - sb.AppendFormat("Superblock last modified on {0}", DateHandlers.UNIXToDateTime(LocusSb.s_time)) + sb.AppendFormat("Superblock last modified on {0}", DateHandlers.UnixToDateTime(LocusSb.s_time)) .AppendLine(); sb.AppendFormat("Volume has {0} blocks of {1} bytes each (total {2} bytes)", LocusSb.s_fsize, blockSize, LocusSb.s_fsize * blockSize).AppendLine(); @@ -350,7 +350,7 @@ namespace DiscImageChef.Filesystems Clusters = LocusSb.s_fsize, // Sometimes it uses one, or the other. Use the bigger VolumeName = string.IsNullOrEmpty(s_fsmnt) ? s_fpack : s_fsmnt, - ModificationDate = DateHandlers.UNIXToDateTime(LocusSb.s_time), + ModificationDate = DateHandlers.UnixToDateTime(LocusSb.s_time), ModificationDateSpecified = true, Dirty = !LocusSb.s_flags.HasFlag(LocusFlags.SB_CLEAN) || LocusSb.s_flags.HasFlag(LocusFlags.SB_DIRTY), FreeClusters = LocusSb.s_tfree, diff --git a/DiscImageChef.Filesystems/NILFS2.cs b/DiscImageChef.Filesystems/NILFS2.cs index d0bcb7394..4b3e029bb 100644 --- a/DiscImageChef.Filesystems/NILFS2.cs +++ b/DiscImageChef.Filesystems/NILFS2.cs @@ -182,10 +182,10 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Volume UUID: {0}", nilfsSb.uuid).AppendLine(); sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(nilfsSb.volume_name, CurrentEncoding)) .AppendLine(); - sb.AppendFormat("Volume created on {0}", DateHandlers.UNIXUnsignedToDateTime(nilfsSb.ctime)).AppendLine(); - sb.AppendFormat("Volume last mounted on {0}", DateHandlers.UNIXUnsignedToDateTime(nilfsSb.mtime)) + sb.AppendFormat("Volume created on {0}", DateHandlers.UnixUnsignedToDateTime(nilfsSb.ctime)).AppendLine(); + sb.AppendFormat("Volume last mounted on {0}", DateHandlers.UnixUnsignedToDateTime(nilfsSb.mtime)) .AppendLine(); - sb.AppendFormat("Volume last written on {0}", DateHandlers.UNIXUnsignedToDateTime(nilfsSb.wtime)) + sb.AppendFormat("Volume last written on {0}", DateHandlers.UnixUnsignedToDateTime(nilfsSb.wtime)) .AppendLine(); information = sb.ToString(); @@ -196,9 +196,9 @@ namespace DiscImageChef.Filesystems ClusterSize = 1 << (int)(nilfsSb.log_block_size + 10), VolumeName = StringHandlers.CToString(nilfsSb.volume_name, CurrentEncoding), VolumeSerial = nilfsSb.uuid.ToString(), - CreationDate = DateHandlers.UNIXUnsignedToDateTime(nilfsSb.ctime), + CreationDate = DateHandlers.UnixUnsignedToDateTime(nilfsSb.ctime), CreationDateSpecified = true, - ModificationDate = DateHandlers.UNIXUnsignedToDateTime(nilfsSb.wtime), + ModificationDate = DateHandlers.UnixUnsignedToDateTime(nilfsSb.wtime), ModificationDateSpecified = true }; if(nilfsSb.creator_os == 0) XmlFsType.SystemIdentifier = "Linux"; diff --git a/DiscImageChef.Filesystems/ODS.cs b/DiscImageChef.Filesystems/ODS.cs index e25ff939d..aabfdf435 100644 --- a/DiscImageChef.Filesystems/ODS.cs +++ b/DiscImageChef.Filesystems/ODS.cs @@ -173,12 +173,12 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Volume label: \"{0}\"", StringHandlers.SpacePaddedToString(homeblock.volname, CurrentEncoding)).AppendLine(); sb.AppendFormat("Drive serial number: 0x{0:X8}", homeblock.serialnum).AppendLine(); - sb.AppendFormat("Volume was created on {0}", DateHandlers.VMSToDateTime(homeblock.credate)).AppendLine(); + sb.AppendFormat("Volume was created on {0}", DateHandlers.VmsToDateTime(homeblock.credate)).AppendLine(); if(homeblock.revdate > 0) - sb.AppendFormat("Volume was last modified on {0}", DateHandlers.VMSToDateTime(homeblock.revdate)) + sb.AppendFormat("Volume was last modified on {0}", DateHandlers.VmsToDateTime(homeblock.revdate)) .AppendLine(); if(homeblock.copydate > 0) - sb.AppendFormat("Volume copied on {0}", DateHandlers.VMSToDateTime(homeblock.copydate)).AppendLine(); + sb.AppendFormat("Volume copied on {0}", DateHandlers.VmsToDateTime(homeblock.copydate)).AppendLine(); sb.AppendFormat("Checksums: 0x{0:X4} and 0x{1:X4}", homeblock.checksum1, homeblock.checksum2).AppendLine(); sb.AppendLine("Flags:"); sb.AppendFormat("Window: {0}", homeblock.window).AppendLine(); @@ -229,12 +229,12 @@ namespace DiscImageChef.Filesystems }; if(homeblock.credate > 0) { - XmlFsType.CreationDate = DateHandlers.VMSToDateTime(homeblock.credate); + XmlFsType.CreationDate = DateHandlers.VmsToDateTime(homeblock.credate); XmlFsType.CreationDateSpecified = true; } if(homeblock.revdate > 0) { - XmlFsType.ModificationDate = DateHandlers.VMSToDateTime(homeblock.revdate); + XmlFsType.ModificationDate = DateHandlers.VmsToDateTime(homeblock.revdate); XmlFsType.ModificationDateSpecified = true; } diff --git a/DiscImageChef.Filesystems/QNX4.cs b/DiscImageChef.Filesystems/QNX4.cs index d2f453749..b1f6216e7 100644 --- a/DiscImageChef.Filesystems/QNX4.cs +++ b/DiscImageChef.Filesystems/QNX4.cs @@ -247,16 +247,16 @@ namespace DiscImageChef.Filesystems */ information = - $"QNX4 filesystem\nCreated on {DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_ftime)}\n"; + $"QNX4 filesystem\nCreated on {DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime)}\n"; XmlFsType = new FileSystemType { Type = "QNX4 filesystem", Clusters = (long)partition.Length, ClusterSize = 512, - CreationDate = DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_ftime), + CreationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime), CreationDateSpecified = true, - ModificationDate = DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_mtime), + ModificationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_mtime), ModificationDateSpecified = true }; XmlFsType.Bootable |= qnxSb.boot.di_size != 0 || qnxSb.altBoot.di_size != 0; diff --git a/DiscImageChef.Filesystems/QNX6.cs b/DiscImageChef.Filesystems/QNX6.cs index 60c84f781..e889f1109 100644 --- a/DiscImageChef.Filesystems/QNX6.cs +++ b/DiscImageChef.Filesystems/QNX6.cs @@ -205,8 +205,8 @@ namespace DiscImageChef.Filesystems sb.AppendLine("QNX6 filesystem"); sb.AppendFormat("Checksum: 0x{0:X8}", qnxSb.checksum).AppendLine(); sb.AppendFormat("Serial: 0x{0:X16}", qnxSb.checksum).AppendLine(); - sb.AppendFormat("Created on {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.ctime)).AppendLine(); - sb.AppendFormat("Last mounted on {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.atime)).AppendLine(); + sb.AppendFormat("Created on {0}", DateHandlers.UnixUnsignedToDateTime(qnxSb.ctime)).AppendLine(); + sb.AppendFormat("Last mounted on {0}", DateHandlers.UnixUnsignedToDateTime(qnxSb.atime)).AppendLine(); sb.AppendFormat("Flags: 0x{0:X8}", qnxSb.flags).AppendLine(); sb.AppendFormat("Version1: 0x{0:X4}", qnxSb.version1).AppendLine(); sb.AppendFormat("Version2: 0x{0:X4}", qnxSb.version2).AppendLine(); @@ -228,9 +228,9 @@ namespace DiscImageChef.Filesystems FreeClusters = qnxSb.freeBlocks, FreeClustersSpecified = true, VolumeSerial = $"{qnxSb.serial:X16}", - CreationDate = DateHandlers.UNIXUnsignedToDateTime(qnxSb.ctime), + CreationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.ctime), CreationDateSpecified = true, - ModificationDate = DateHandlers.UNIXUnsignedToDateTime(qnxSb.atime), + ModificationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.atime), ModificationDateSpecified = true }; //xmlFSType.VolumeName = CurrentEncoding.GetString(qnxSb.volumeid); diff --git a/DiscImageChef.Filesystems/RBF.cs b/DiscImageChef.Filesystems/RBF.cs index 0eae4ebe7..1e667499c 100644 --- a/DiscImageChef.Filesystems/RBF.cs +++ b/DiscImageChef.Filesystems/RBF.cs @@ -268,10 +268,10 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Root directory descriptor starts at block {0}", rbf9000Sb.rid_rootdir).AppendLine(); sb.AppendFormat("Disk is owned by group {0} user {1}", rbf9000Sb.rid_group, rbf9000Sb.rid_owner) .AppendLine(); - sb.AppendFormat("Volume was created on {0}", DateHandlers.UNIXToDateTime(rbf9000Sb.rid_ctime)) + sb.AppendFormat("Volume was created on {0}", DateHandlers.UnixToDateTime(rbf9000Sb.rid_ctime)) .AppendLine(); sb.AppendFormat("Volume's identification block was last written on {0}", - DateHandlers.UNIXToDateTime(rbf9000Sb.rid_mtime)).AppendLine(); + DateHandlers.UnixToDateTime(rbf9000Sb.rid_mtime)).AppendLine(); sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(rbf9000Sb.rid_name, CurrentEncoding)) .AppendLine(); @@ -281,9 +281,9 @@ namespace DiscImageChef.Filesystems Bootable = rbf9000Sb.rid_bootfile > 0, ClusterSize = rbf9000Sb.rid_blocksize, Clusters = rbf9000Sb.rid_totblocks, - CreationDate = DateHandlers.UNIXToDateTime(rbf9000Sb.rid_ctime), + CreationDate = DateHandlers.UnixToDateTime(rbf9000Sb.rid_ctime), CreationDateSpecified = true, - ModificationDate = DateHandlers.UNIXToDateTime(rbf9000Sb.rid_mtime), + ModificationDate = DateHandlers.UnixToDateTime(rbf9000Sb.rid_mtime), ModificationDateSpecified = true, VolumeName = StringHandlers.CToString(rbf9000Sb.rid_name, CurrentEncoding), VolumeSerial = $"{rbf9000Sb.rid_diskid:X8}" @@ -314,7 +314,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Root directory descriptor starts at block {0}", LSNToUInt32(rbfSb.dd_dir)) .AppendLine(); sb.AppendFormat("Disk is owned by user {0}", rbfSb.dd_own).AppendLine(); - sb.AppendFormat("Volume was created on {0}", DateHandlers.OS9ToDateTime(rbfSb.dd_dat)).AppendLine(); + sb.AppendFormat("Volume was created on {0}", DateHandlers.Os9ToDateTime(rbfSb.dd_dat)).AppendLine(); sb.AppendFormat("Volume attributes: {0:X2}", rbfSb.dd_att).AppendLine(); sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(rbfSb.dd_nam, CurrentEncoding)) .AppendLine(); @@ -327,7 +327,7 @@ namespace DiscImageChef.Filesystems Bootable = LSNToUInt32(rbfSb.dd_bt) > 0 && rbfSb.dd_bsz > 0, ClusterSize = rbfSb.dd_bit * (256 << rbfSb.dd_lsnsize), Clusters = LSNToUInt32(rbfSb.dd_tot), - CreationDate = DateHandlers.OS9ToDateTime(rbfSb.dd_dat), + CreationDate = DateHandlers.Os9ToDateTime(rbfSb.dd_dat), CreationDateSpecified = true, VolumeName = StringHandlers.CToString(rbfSb.dd_nam, CurrentEncoding), VolumeSerial = $"{rbfSb.dd_dsk:X4}" diff --git a/DiscImageChef.Filesystems/Reiser.cs b/DiscImageChef.Filesystems/Reiser.cs index 6126ac974..62f8db488 100644 --- a/DiscImageChef.Filesystems/Reiser.cs +++ b/DiscImageChef.Filesystems/Reiser.cs @@ -172,7 +172,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("{0} bytes per block", reiserSb.blocksize).AppendLine(); sb.AppendFormat("Root directory resides on block {0}", reiserSb.root_block).AppendLine(); if(reiserSb.umount_state == 2) sb.AppendLine("Volume has not been cleanly umounted"); - sb.AppendFormat("Volume last checked on {0}", DateHandlers.UNIXUnsignedToDateTime(reiserSb.last_check)) + sb.AppendFormat("Volume last checked on {0}", DateHandlers.UnixUnsignedToDateTime(reiserSb.last_check)) .AppendLine(); if(reiserSb.version >= 2) { diff --git a/DiscImageChef.Filesystems/SFS.cs b/DiscImageChef.Filesystems/SFS.cs index 726a7b5ec..48f8ecb60 100644 --- a/DiscImageChef.Filesystems/SFS.cs +++ b/DiscImageChef.Filesystems/SFS.cs @@ -132,7 +132,7 @@ namespace DiscImageChef.Filesystems .AppendFormat("Volume has {0} blocks of {1} bytes each", rootBlock.totalblocks, rootBlock.blocksize) .AppendLine(); sbInformation.AppendFormat("Volume created on {0}", - DateHandlers.UNIXUnsignedToDateTime(rootBlock.datecreated).AddYears(8)) + DateHandlers.UnixUnsignedToDateTime(rootBlock.datecreated).AddYears(8)) .AppendLine(); sbInformation.AppendFormat("Bitmap starts in block {0}", rootBlock.bitmapbase).AppendLine(); sbInformation.AppendFormat("Admin space container starts in block {0}", rootBlock.adminspacecontainer) @@ -150,7 +150,7 @@ namespace DiscImageChef.Filesystems XmlFsType = new FileSystemType { - CreationDate = DateHandlers.UNIXUnsignedToDateTime(rootBlock.datecreated).AddYears(8), + CreationDate = DateHandlers.UnixUnsignedToDateTime(rootBlock.datecreated).AddYears(8), CreationDateSpecified = true, Clusters = rootBlock.totalblocks, ClusterSize = (int)rootBlock.blocksize, diff --git a/DiscImageChef.Filesystems/Squash.cs b/DiscImageChef.Filesystems/Squash.cs index 5b3c1bcfe..ceb7a2ee4 100644 --- a/DiscImageChef.Filesystems/Squash.cs +++ b/DiscImageChef.Filesystems/Squash.cs @@ -143,7 +143,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("Volume version {0}.{1}", sqSb.s_major, sqSb.s_minor).AppendLine(); sbInformation.AppendFormat("Volume has {0} bytes", sqSb.bytes_used).AppendLine(); sbInformation.AppendFormat("Volume has {0} bytes per block", sqSb.block_size).AppendLine(); - sbInformation.AppendFormat("Volume created on {0}", DateHandlers.UNIXUnsignedToDateTime(sqSb.mkfs_time)) + sbInformation.AppendFormat("Volume created on {0}", DateHandlers.UnixUnsignedToDateTime(sqSb.mkfs_time)) .AppendLine(); sbInformation.AppendFormat("Volume has {0} inodes", sqSb.inodes).AppendLine(); switch(sqSb.compression) @@ -177,7 +177,7 @@ namespace DiscImageChef.Filesystems XmlFsType = new FileSystemType { Type = "Squash file system", - CreationDate = DateHandlers.UNIXUnsignedToDateTime(sqSb.mkfs_time), + CreationDate = DateHandlers.UnixUnsignedToDateTime(sqSb.mkfs_time), CreationDateSpecified = true, Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.ImageInfo.SectorSize / sqSb.block_size), diff --git a/DiscImageChef.Filesystems/SysV.cs b/DiscImageChef.Filesystems/SysV.cs index a72921ca1..98b2ac7c1 100644 --- a/DiscImageChef.Filesystems/SysV.cs +++ b/DiscImageChef.Filesystems/SysV.cs @@ -424,11 +424,11 @@ namespace DiscImageChef.Filesystems if(xnx_sb.s_ilock > 0) sb.AppendLine("inode cache is locked"); if(xnx_sb.s_fmod > 0) sb.AppendLine("Superblock is being modified"); if(xnx_sb.s_ronly > 0) sb.AppendLine("Volume is mounted read-only"); - sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXToDateTime(xnx_sb.s_time)) + sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UnixToDateTime(xnx_sb.s_time)) .AppendLine(); if(xnx_sb.s_time != 0) { - XmlFsType.ModificationDate = DateHandlers.UNIXToDateTime(xnx_sb.s_time); + XmlFsType.ModificationDate = DateHandlers.UnixToDateTime(xnx_sb.s_time); XmlFsType.ModificationDateSpecified = true; } sb.AppendFormat("Volume name: {0}", xnx_sb.s_fname).AppendLine(); @@ -545,11 +545,11 @@ namespace DiscImageChef.Filesystems if(sysv_sb.s_ilock > 0) sb.AppendLine("inode cache is locked"); if(sysv_sb.s_fmod > 0) sb.AppendLine("Superblock is being modified"); if(sysv_sb.s_ronly > 0) sb.AppendLine("Volume is mounted read-only"); - sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXUnsignedToDateTime(sysv_sb.s_time)) + sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time)) .AppendLine(); if(sysv_sb.s_time != 0) { - XmlFsType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(sysv_sb.s_time); + XmlFsType.ModificationDate = DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time); XmlFsType.ModificationDateSpecified = true; } sb.AppendFormat("Volume name: {0}", sysv_sb.s_fname).AppendLine(); @@ -608,11 +608,11 @@ namespace DiscImageChef.Filesystems if(coh_sb.s_ilock > 0) sb.AppendLine("inode cache is locked"); if(coh_sb.s_fmod > 0) sb.AppendLine("Superblock is being modified"); if(coh_sb.s_ronly > 0) sb.AppendLine("Volume is mounted read-only"); - sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXUnsignedToDateTime(coh_sb.s_time)) + sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time)) .AppendLine(); if(coh_sb.s_time != 0) { - XmlFsType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(coh_sb.s_time); + XmlFsType.ModificationDate = DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time); XmlFsType.ModificationDateSpecified = true; } sb.AppendFormat("Volume name: {0}", coh_sb.s_fname).AppendLine(); @@ -663,11 +663,11 @@ namespace DiscImageChef.Filesystems if(v7_sb.s_ilock > 0) sb.AppendLine("inode cache is locked"); if(v7_sb.s_fmod > 0) sb.AppendLine("Superblock is being modified"); if(v7_sb.s_ronly > 0) sb.AppendLine("Volume is mounted read-only"); - sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXUnsignedToDateTime(v7_sb.s_time)) + sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time)) .AppendLine(); if(v7_sb.s_time != 0) { - XmlFsType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(v7_sb.s_time); + XmlFsType.ModificationDate = DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time); XmlFsType.ModificationDateSpecified = true; } sb.AppendFormat("Volume name: {0}", v7_sb.s_fname).AppendLine(); diff --git a/DiscImageChef.Filesystems/UCSDPascal/File.cs b/DiscImageChef.Filesystems/UCSDPascal/File.cs index 159983013..5220e1e28 100644 --- a/DiscImageChef.Filesystems/UCSDPascal/File.cs +++ b/DiscImageChef.Filesystems/UCSDPascal/File.cs @@ -145,7 +145,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal DeviceNo = 0, GID = 0, Inode = 0, - LastWriteTimeUtc = DateHandlers.UCSDPascalToDateTime(entry.mtime), + LastWriteTimeUtc = DateHandlers.UcsdPascalToDateTime(entry.mtime), Length = (entry.lastBlock - entry.firstBlock) * device.GetSectorSize() + entry.lastBytes, Links = 1, Mode = 0x124, diff --git a/DiscImageChef.Filesystems/UCSDPascal/Info.cs b/DiscImageChef.Filesystems/UCSDPascal/Info.cs index 2150cef55..9c8171fc0 100644 --- a/DiscImageChef.Filesystems/UCSDPascal/Info.cs +++ b/DiscImageChef.Filesystems/UCSDPascal/Info.cs @@ -138,7 +138,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal sbInformation.AppendFormat("Volume has {0} blocks", volEntry.blocks).AppendLine(); sbInformation.AppendFormat("Volume has {0} files", volEntry.files).AppendLine(); sbInformation - .AppendFormat("Volume last booted at {0}", DateHandlers.UCSDPascalToDateTime(volEntry.lastBoot)) + .AppendFormat("Volume last booted at {0}", DateHandlers.UcsdPascalToDateTime(volEntry.lastBoot)) .AppendLine(); information = sbInformation.ToString(); diff --git a/DiscImageChef.Filesystems/UDF.cs b/DiscImageChef.Filesystems/UDF.cs index e848678f1..5adf7c14e 100644 --- a/DiscImageChef.Filesystems/UDF.cs +++ b/DiscImageChef.Filesystems/UDF.cs @@ -468,7 +468,7 @@ namespace DiscImageChef.Filesystems static DateTime EcmaToDateTime(Timestamp timestamp) { - return DateHandlers.ECMAToDateTime(timestamp.typeAndZone, timestamp.year, timestamp.month, timestamp.day, + return DateHandlers.EcmaToDateTime(timestamp.typeAndZone, timestamp.year, timestamp.month, timestamp.day, timestamp.hour, timestamp.minute, timestamp.second, timestamp.centiseconds, timestamp.hundredsMicroseconds, timestamp.microseconds); diff --git a/DiscImageChef.Filesystems/UNICOS.cs b/DiscImageChef.Filesystems/UNICOS.cs index 887ed6aff..61997ed59 100644 --- a/DiscImageChef.Filesystems/UNICOS.cs +++ b/DiscImageChef.Filesystems/UNICOS.cs @@ -206,7 +206,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("{0} data blocks in volume", unicosSb.s_fsize).AppendLine(); sb.AppendFormat("Root resides on inode {0}", unicosSb.s_root).AppendLine(); sb.AppendFormat("{0} inodes in volume", unicosSb.s_isize).AppendLine(); - sb.AppendFormat("Volume last updated on {0}", DateHandlers.UNIXToDateTime(unicosSb.s_time)).AppendLine(); + sb.AppendFormat("Volume last updated on {0}", DateHandlers.UnixToDateTime(unicosSb.s_time)).AppendLine(); if(unicosSb.s_error > 0) sb.AppendFormat("Volume is dirty, error code = 0x{0:X16}", unicosSb.s_error).AppendLine(); sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(unicosSb.s_fname, CurrentEncoding)) @@ -220,7 +220,7 @@ namespace DiscImageChef.Filesystems ClusterSize = 4096, Clusters = unicosSb.s_fsize, VolumeName = StringHandlers.CToString(unicosSb.s_fname, CurrentEncoding), - ModificationDate = DateHandlers.UNIXToDateTime(unicosSb.s_time), + ModificationDate = DateHandlers.UnixToDateTime(unicosSb.s_time), ModificationDateSpecified = true }; XmlFsType.Dirty |= unicosSb.s_error > 0; diff --git a/DiscImageChef.Filesystems/VMfs.cs b/DiscImageChef.Filesystems/VMfs.cs index 0f0b3f19d..a22db61c7 100644 --- a/DiscImageChef.Filesystems/VMfs.cs +++ b/DiscImageChef.Filesystems/VMfs.cs @@ -135,19 +135,19 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("Volume size {0} bytes", volInfo.size * 256).AppendLine(); sbInformation.AppendFormat("Volume UUID {0}", volInfo.uuid).AppendLine(); sbInformation - .AppendFormat("Volume created on {0}", DateHandlers.UNIXUnsignedToDateTime(ctimeSecs, ctimeNanoSecs)) + .AppendFormat("Volume created on {0}", DateHandlers.UnixUnsignedToDateTime(ctimeSecs, ctimeNanoSecs)) .AppendLine(); sbInformation.AppendFormat("Volume last modified on {0}", - DateHandlers.UNIXUnsignedToDateTime(mtimeSecs, mtimeNanoSecs)).AppendLine(); + DateHandlers.UnixUnsignedToDateTime(mtimeSecs, mtimeNanoSecs)).AppendLine(); information = sbInformation.ToString(); XmlFsType = new FileSystemType { Type = "VMware file system", - CreationDate = DateHandlers.UNIXUnsignedToDateTime(ctimeSecs, ctimeNanoSecs), + CreationDate = DateHandlers.UnixUnsignedToDateTime(ctimeSecs, ctimeNanoSecs), CreationDateSpecified = true, - ModificationDate = DateHandlers.UNIXUnsignedToDateTime(mtimeSecs, mtimeNanoSecs), + ModificationDate = DateHandlers.UnixUnsignedToDateTime(mtimeSecs, mtimeNanoSecs), ModificationDateSpecified = true, Clusters = volInfo.size * 256 / imagePlugin.ImageInfo.SectorSize, ClusterSize = (int)imagePlugin.ImageInfo.SectorSize, diff --git a/DiscImageChef.Filesystems/VxFS.cs b/DiscImageChef.Filesystems/VxFS.cs index b675859c4..b2195b1b6 100644 --- a/DiscImageChef.Filesystems/VxFS.cs +++ b/DiscImageChef.Filesystems/VxFS.cs @@ -250,9 +250,9 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("Volume has {0} free inodes", vxSb.vs_ifree).AppendLine(); sbInformation.AppendFormat("Volume has {0} free blocks", vxSb.vs_free).AppendLine(); sbInformation.AppendFormat("Volume created on {0}", - DateHandlers.UNIXUnsignedToDateTime(vxSb.vs_ctime, vxSb.vs_cutime)).AppendLine(); + DateHandlers.UnixUnsignedToDateTime(vxSb.vs_ctime, vxSb.vs_cutime)).AppendLine(); sbInformation.AppendFormat("Volume last modified on {0}", - DateHandlers.UNIXUnsignedToDateTime(vxSb.vs_wtime, vxSb.vs_wutime)).AppendLine(); + DateHandlers.UnixUnsignedToDateTime(vxSb.vs_wtime, vxSb.vs_wutime)).AppendLine(); if(vxSb.vs_clean != 0) sbInformation.AppendLine("Volume is dirty"); information = sbInformation.ToString(); @@ -260,9 +260,9 @@ namespace DiscImageChef.Filesystems XmlFsType = new FileSystemType { Type = "Veritas file system", - CreationDate = DateHandlers.UNIXUnsignedToDateTime(vxSb.vs_ctime, vxSb.vs_cutime), + CreationDate = DateHandlers.UnixUnsignedToDateTime(vxSb.vs_ctime, vxSb.vs_cutime), CreationDateSpecified = true, - ModificationDate = DateHandlers.UNIXUnsignedToDateTime(vxSb.vs_wtime, vxSb.vs_wutime), + ModificationDate = DateHandlers.UnixUnsignedToDateTime(vxSb.vs_wtime, vxSb.vs_wutime), ModificationDateSpecified = true, Clusters = vxSb.vs_size, ClusterSize = vxSb.vs_bsize, diff --git a/DiscImageChef.Filesystems/ZFS.cs b/DiscImageChef.Filesystems/ZFS.cs index 3fa2f54ca..d33ee8b17 100644 --- a/DiscImageChef.Filesystems/ZFS.cs +++ b/DiscImageChef.Filesystems/ZFS.cs @@ -441,7 +441,7 @@ namespace DiscImageChef.Filesystems for(int i = 0; i < item.elements; i++) { DateTime temp = - DateHandlers.UNIXHrTimeToDateTime(BigEndianBitConverter.ToUInt64(nvlist, offset)); + DateHandlers.UnixHrTimeToDateTime(BigEndianBitConverter.ToUInt64(nvlist, offset)); hrtimeArray[i] = temp; offset += 8; } @@ -451,7 +451,7 @@ namespace DiscImageChef.Filesystems else { item.value = - DateHandlers.UNIXHrTimeToDateTime(BigEndianBitConverter.ToUInt64(nvlist, offset)); + DateHandlers.UnixHrTimeToDateTime(BigEndianBitConverter.ToUInt64(nvlist, offset)); offset += 8; } diff --git a/DiscImageChef.Filesystems/dump.cs b/DiscImageChef.Filesystems/dump.cs index 067be97ff..b85620557 100644 --- a/DiscImageChef.Filesystems/dump.cs +++ b/DiscImageChef.Filesystems/dump.cs @@ -345,13 +345,13 @@ namespace DiscImageChef.Filesystems sb.AppendLine(XmlFsType.Type); if(oldHdr.c_date > 0) { - XmlFsType.CreationDate = DateHandlers.UNIXToDateTime(oldHdr.c_date); + XmlFsType.CreationDate = DateHandlers.UnixToDateTime(oldHdr.c_date); XmlFsType.CreationDateSpecified = true; sb.AppendFormat("Dump created on {0}", XmlFsType.CreationDate).AppendLine(); } if(oldHdr.c_ddate > 0) { - XmlFsType.BackupDate = DateHandlers.UNIXToDateTime(oldHdr.c_ddate); + XmlFsType.BackupDate = DateHandlers.UnixToDateTime(oldHdr.c_ddate); XmlFsType.BackupDateSpecified = true; sb.AppendFormat("Previous dump created on {0}", XmlFsType.BackupDate).AppendLine(); } @@ -363,13 +363,13 @@ namespace DiscImageChef.Filesystems sb.AppendLine(XmlFsType.Type); if(aixHdr.c_date > 0) { - XmlFsType.CreationDate = DateHandlers.UNIXToDateTime(aixHdr.c_date); + XmlFsType.CreationDate = DateHandlers.UnixToDateTime(aixHdr.c_date); XmlFsType.CreationDateSpecified = true; sb.AppendFormat("Dump created on {0}", XmlFsType.CreationDate).AppendLine(); } if(aixHdr.c_ddate > 0) { - XmlFsType.BackupDate = DateHandlers.UNIXToDateTime(aixHdr.c_ddate); + XmlFsType.BackupDate = DateHandlers.UnixToDateTime(aixHdr.c_ddate); XmlFsType.BackupDateSpecified = true; sb.AppendFormat("Previous dump created on {0}", XmlFsType.BackupDate).AppendLine(); } @@ -381,25 +381,25 @@ namespace DiscImageChef.Filesystems sb.AppendLine(XmlFsType.Type); if(newHdr.c_ndate > 0) { - XmlFsType.CreationDate = DateHandlers.UNIXToDateTime(newHdr.c_ndate); + XmlFsType.CreationDate = DateHandlers.UnixToDateTime(newHdr.c_ndate); XmlFsType.CreationDateSpecified = true; sb.AppendFormat("Dump created on {0}", XmlFsType.CreationDate).AppendLine(); } else if(newHdr.c_date > 0) { - XmlFsType.CreationDate = DateHandlers.UNIXToDateTime(newHdr.c_date); + XmlFsType.CreationDate = DateHandlers.UnixToDateTime(newHdr.c_date); XmlFsType.CreationDateSpecified = true; sb.AppendFormat("Dump created on {0}", XmlFsType.CreationDate).AppendLine(); } if(newHdr.c_nddate > 0) { - XmlFsType.BackupDate = DateHandlers.UNIXToDateTime(newHdr.c_nddate); + XmlFsType.BackupDate = DateHandlers.UnixToDateTime(newHdr.c_nddate); XmlFsType.BackupDateSpecified = true; sb.AppendFormat("Previous dump created on {0}", XmlFsType.BackupDate).AppendLine(); } else if(newHdr.c_ddate > 0) { - XmlFsType.BackupDate = DateHandlers.UNIXToDateTime(newHdr.c_ddate); + XmlFsType.BackupDate = DateHandlers.UnixToDateTime(newHdr.c_ddate); XmlFsType.BackupDateSpecified = true; sb.AppendFormat("Previous dump created on {0}", XmlFsType.BackupDate).AppendLine(); } diff --git a/DiscImageChef.Filesystems/ext2FS.cs b/DiscImageChef.Filesystems/ext2FS.cs index 9eaf7526d..be46ca745 100644 --- a/DiscImageChef.Filesystems/ext2FS.cs +++ b/DiscImageChef.Filesystems/ext2FS.cs @@ -189,9 +189,9 @@ namespace DiscImageChef.Filesystems if(supblk.mkfs_t > 0) { - sb.AppendFormat("Volume was created on {0} for {1}", DateHandlers.UNIXUnsignedToDateTime(supblk.mkfs_t), + sb.AppendFormat("Volume was created on {0} for {1}", DateHandlers.UnixUnsignedToDateTime(supblk.mkfs_t), extOs).AppendLine(); - XmlFsType.CreationDate = DateHandlers.UNIXUnsignedToDateTime(supblk.mkfs_t); + XmlFsType.CreationDate = DateHandlers.UnixUnsignedToDateTime(supblk.mkfs_t); XmlFsType.CreationDateSpecified = true; } else sb.AppendFormat("Volume was created for {0}", extOs).AppendLine(); @@ -255,7 +255,7 @@ namespace DiscImageChef.Filesystems if(supblk.mount_t > 0 || supblk.mount_c > 0) { if(supblk.mount_t > 0) - sb.AppendFormat("Last mounted on {0}", DateHandlers.UNIXUnsignedToDateTime(supblk.mount_t)) + sb.AppendFormat("Last mounted on {0}", DateHandlers.UnixUnsignedToDateTime(supblk.mount_t)) .AppendLine(); if(supblk.max_mount_c != -1) sb.AppendFormat("Volume has been mounted {0} times of a maximum of {1} mounts before checking", @@ -281,9 +281,9 @@ namespace DiscImageChef.Filesystems if(supblk.check_t > 0) if(supblk.check_inv > 0) sb.AppendFormat("Last checked on {0} (should check every {1} seconds)", - DateHandlers.UNIXUnsignedToDateTime(supblk.check_t), supblk.check_inv).AppendLine(); + DateHandlers.UnixUnsignedToDateTime(supblk.check_t), supblk.check_inv).AppendLine(); else - sb.AppendFormat("Last checked on {0}", DateHandlers.UNIXUnsignedToDateTime(supblk.check_t)) + sb.AppendFormat("Last checked on {0}", DateHandlers.UnixUnsignedToDateTime(supblk.check_t)) .AppendLine(); else { @@ -295,9 +295,9 @@ namespace DiscImageChef.Filesystems if(supblk.write_t > 0) { - sb.AppendFormat("Last written on {0}", DateHandlers.UNIXUnsignedToDateTime(supblk.write_t)) + sb.AppendFormat("Last written on {0}", DateHandlers.UnixUnsignedToDateTime(supblk.write_t)) .AppendLine(); - XmlFsType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(supblk.write_t); + XmlFsType.ModificationDate = DateHandlers.UnixUnsignedToDateTime(supblk.write_t); XmlFsType.ModificationDateSpecified = true; } else sb.AppendLine("Volume has never been written"); @@ -415,8 +415,8 @@ namespace DiscImageChef.Filesystems { sb.AppendFormat("{0} errors registered", supblk.error_count).AppendLine(); sb.AppendFormat("First error occurred on {0}, last on {1}", - DateHandlers.UNIXUnsignedToDateTime(supblk.first_error_t), - DateHandlers.UNIXUnsignedToDateTime(supblk.last_error_t)).AppendLine(); + DateHandlers.UnixUnsignedToDateTime(supblk.first_error_t), + DateHandlers.UnixUnsignedToDateTime(supblk.last_error_t)).AppendLine(); sb.AppendFormat("First error inode is {0}, last is {1}", supblk.first_error_inode, supblk.last_error_inode).AppendLine(); sb.AppendFormat("First error block is {0}, last is {1}", supblk.first_error_block, diff --git a/DiscImageChef.Filters/AppleDouble.cs b/DiscImageChef.Filters/AppleDouble.cs index 81b42074e..afc91a1d9 100644 --- a/DiscImageChef.Filters/AppleDouble.cs +++ b/DiscImageChef.Filters/AppleDouble.cs @@ -590,8 +590,8 @@ namespace DiscImageChef.Filters fs.Read(dates_b, 0, 16); AppleDoubleFileDates dates = BigEndianMarshal.ByteArrayToStructureBigEndian(dates_b); - creationTime = DateHandlers.UNIXUnsignedToDateTime(dates.creationDate); - lastWriteTime = DateHandlers.UNIXUnsignedToDateTime(dates.modificationDate); + creationTime = DateHandlers.UnixUnsignedToDateTime(dates.creationDate); + lastWriteTime = DateHandlers.UnixUnsignedToDateTime(dates.modificationDate); break; case AppleDoubleEntryID.FileInfo: fs.Seek(entry.offset, SeekOrigin.Begin); @@ -615,15 +615,15 @@ namespace DiscImageChef.Filters { AppleDoubleUNIXFileInfo unixinfo = BigEndianMarshal.ByteArrayToStructureBigEndian(finfo); - creationTime = DateHandlers.UNIXUnsignedToDateTime(unixinfo.creationDate); - lastWriteTime = DateHandlers.UNIXUnsignedToDateTime(unixinfo.modificationDate); + creationTime = DateHandlers.UnixUnsignedToDateTime(unixinfo.creationDate); + lastWriteTime = DateHandlers.UnixUnsignedToDateTime(unixinfo.modificationDate); } else if(DOSHome.SequenceEqual(header.homeFilesystem)) { AppleDoubleDOSFileInfo dosinfo = BigEndianMarshal.ByteArrayToStructureBigEndian(finfo); lastWriteTime = - DateHandlers.DOSToDateTime(dosinfo.modificationDate, dosinfo.modificationTime); + DateHandlers.DosToDateTime(dosinfo.modificationDate, dosinfo.modificationTime); } break; case AppleDoubleEntryID.ResourceFork: diff --git a/DiscImageChef.Filters/AppleSingle.cs b/DiscImageChef.Filters/AppleSingle.cs index 783b20603..d7873ef28 100644 --- a/DiscImageChef.Filters/AppleSingle.cs +++ b/DiscImageChef.Filters/AppleSingle.cs @@ -315,8 +315,8 @@ namespace DiscImageChef.Filters ms.Read(dates_b, 0, 16); AppleSingleFileDates dates = BigEndianMarshal.ByteArrayToStructureBigEndian(dates_b); - creationTime = DateHandlers.UNIXUnsignedToDateTime(dates.creationDate); - lastWriteTime = DateHandlers.UNIXUnsignedToDateTime(dates.modificationDate); + creationTime = DateHandlers.UnixUnsignedToDateTime(dates.creationDate); + lastWriteTime = DateHandlers.UnixUnsignedToDateTime(dates.modificationDate); break; case AppleSingleEntryID.FileInfo: ms.Seek(entry.offset, SeekOrigin.Begin); @@ -340,15 +340,15 @@ namespace DiscImageChef.Filters { AppleSingleUNIXFileInfo unixinfo = BigEndianMarshal.ByteArrayToStructureBigEndian(finfo); - creationTime = DateHandlers.UNIXUnsignedToDateTime(unixinfo.creationDate); - lastWriteTime = DateHandlers.UNIXUnsignedToDateTime(unixinfo.modificationDate); + creationTime = DateHandlers.UnixUnsignedToDateTime(unixinfo.creationDate); + lastWriteTime = DateHandlers.UnixUnsignedToDateTime(unixinfo.modificationDate); } else if(DOSHome.SequenceEqual(header.homeFilesystem)) { AppleSingleDOSFileInfo dosinfo = BigEndianMarshal.ByteArrayToStructureBigEndian(finfo); lastWriteTime = - DateHandlers.DOSToDateTime(dosinfo.modificationDate, dosinfo.modificationTime); + DateHandlers.DosToDateTime(dosinfo.modificationDate, dosinfo.modificationTime); } break; case AppleSingleEntryID.ResourceFork: @@ -417,15 +417,15 @@ namespace DiscImageChef.Filters { AppleSingleUNIXFileInfo unixinfo = BigEndianMarshal.ByteArrayToStructureBigEndian(finfo); - creationTime = DateHandlers.UNIXUnsignedToDateTime(unixinfo.creationDate); - lastWriteTime = DateHandlers.UNIXUnsignedToDateTime(unixinfo.modificationDate); + creationTime = DateHandlers.UnixUnsignedToDateTime(unixinfo.creationDate); + lastWriteTime = DateHandlers.UnixUnsignedToDateTime(unixinfo.modificationDate); } else if(DOSHome.SequenceEqual(header.homeFilesystem)) { AppleSingleDOSFileInfo dosinfo = BigEndianMarshal.ByteArrayToStructureBigEndian(finfo); lastWriteTime = - DateHandlers.DOSToDateTime(dosinfo.modificationDate, dosinfo.modificationTime); + DateHandlers.DosToDateTime(dosinfo.modificationDate, dosinfo.modificationTime); } break; case AppleSingleEntryID.ResourceFork: @@ -495,15 +495,15 @@ namespace DiscImageChef.Filters { AppleSingleUNIXFileInfo unixinfo = BigEndianMarshal.ByteArrayToStructureBigEndian(finfo); - creationTime = DateHandlers.UNIXUnsignedToDateTime(unixinfo.creationDate); - lastWriteTime = DateHandlers.UNIXUnsignedToDateTime(unixinfo.modificationDate); + creationTime = DateHandlers.UnixUnsignedToDateTime(unixinfo.creationDate); + lastWriteTime = DateHandlers.UnixUnsignedToDateTime(unixinfo.modificationDate); } else if(DOSHome.SequenceEqual(header.homeFilesystem)) { AppleSingleDOSFileInfo dosinfo = BigEndianMarshal.ByteArrayToStructureBigEndian(finfo); lastWriteTime = - DateHandlers.DOSToDateTime(dosinfo.modificationDate, dosinfo.modificationTime); + DateHandlers.DosToDateTime(dosinfo.modificationDate, dosinfo.modificationTime); } break; case AppleSingleEntryID.ResourceFork: diff --git a/DiscImageChef.Filters/GZip.cs b/DiscImageChef.Filters/GZip.cs index 90e1cc539..d489663d3 100644 --- a/DiscImageChef.Filters/GZip.cs +++ b/DiscImageChef.Filters/GZip.cs @@ -135,7 +135,7 @@ namespace DiscImageChef.Filters isize = BitConverter.ToUInt32(isize_b, 0); decompressedSize = isize; - creationTime = DateHandlers.UNIXUnsignedToDateTime(mtime); + creationTime = DateHandlers.UnixUnsignedToDateTime(mtime); lastWriteTime = creationTime; zStream = new ForcedSeekStream(decompressedSize, dataStream, CompressionMode.Decompress); opened = true; @@ -161,7 +161,7 @@ namespace DiscImageChef.Filters isize = BitConverter.ToUInt32(isize_b, 0); decompressedSize = isize; - creationTime = DateHandlers.UNIXUnsignedToDateTime(mtime); + creationTime = DateHandlers.UnixUnsignedToDateTime(mtime); lastWriteTime = creationTime; zStream = new ForcedSeekStream(decompressedSize, dataStream, CompressionMode.Decompress); opened = true; @@ -189,7 +189,7 @@ namespace DiscImageChef.Filters decompressedSize = isize; FileInfo fi = new FileInfo(path); creationTime = fi.CreationTimeUtc; - lastWriteTime = DateHandlers.UNIXUnsignedToDateTime(mtime); + lastWriteTime = DateHandlers.UnixUnsignedToDateTime(mtime); zStream = new ForcedSeekStream(decompressedSize, dataStream, CompressionMode.Decompress); opened = true; } diff --git a/DiscImageChef.Helpers/DateHandlers.cs b/DiscImageChef.Helpers/DateHandlers.cs index 6fb1b5bf6..87f0b7105 100644 --- a/DiscImageChef.Helpers/DateHandlers.cs +++ b/DiscImageChef.Helpers/DateHandlers.cs @@ -40,59 +40,61 @@ namespace DiscImageChef { static readonly DateTime LisaEpoch = new DateTime(1901, 1, 1, 0, 0, 0); static readonly DateTime MacEpoch = new DateTime(1904, 1, 1, 0, 0, 0); - static readonly DateTime UNIXEpoch = new DateTime(1970, 1, 1, 0, 0, 0); - // Day 0 of Julian Date system + static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0); + /// + /// Day 0 of Julian Date system + /// static readonly DateTime JulianEpoch = new DateTime(1858, 11, 17, 0, 0, 0); static readonly DateTime AmigaEpoch = new DateTime(1978, 1, 1, 0, 0, 0); /// /// Converts a Macintosh timestamp to a .NET DateTime /// - /// Macintosh timestamp (seconds since 1st Jan. 1904) + /// Macintosh timestamp (seconds since 1st Jan. 1904) /// .NET DateTime - public static DateTime MacToDateTime(ulong MacTimeStamp) + public static DateTime MacToDateTime(ulong macTimeStamp) { - return MacEpoch.AddTicks((long)(MacTimeStamp * 10000000)); + return MacEpoch.AddTicks((long)(macTimeStamp * 10000000)); } /// /// Converts a Lisa timestamp to a .NET DateTime /// - /// Lisa timestamp (seconds since 1st Jan. 1901) + /// Lisa timestamp (seconds since 1st Jan. 1901) /// .NET DateTime - public static DateTime LisaToDateTime(uint LisaTimeStamp) + public static DateTime LisaToDateTime(uint lisaTimeStamp) { - return LisaEpoch.AddSeconds(LisaTimeStamp); + return LisaEpoch.AddSeconds(lisaTimeStamp); } /// /// Converts a UNIX timestamp to a .NET DateTime /// - /// UNIX timestamp (seconds since 1st Jan. 1970) + /// UNIX timestamp (seconds since 1st Jan. 1970) /// .NET DateTime - public static DateTime UNIXToDateTime(int UNIXTimeStamp) + public static DateTime UnixToDateTime(int unixTimeStamp) { - return UNIXEpoch.AddSeconds(UNIXTimeStamp); + return UnixEpoch.AddSeconds(unixTimeStamp); } /// /// Converts a UNIX timestamp to a .NET DateTime /// - /// UNIX timestamp (seconds since 1st Jan. 1970) + /// UNIX timestamp (seconds since 1st Jan. 1970) /// .NET DateTime - public static DateTime UNIXToDateTime(long UNIXTimeStamp) + public static DateTime UnixToDateTime(long unixTimeStamp) { - return UNIXEpoch.AddSeconds(UNIXTimeStamp); + return UnixEpoch.AddSeconds(unixTimeStamp); } /// /// Converts a UNIX timestamp to a .NET DateTime /// - /// UNIX timestamp (seconds since 1st Jan. 1970) + /// UNIX timestamp (seconds since 1st Jan. 1970) /// .NET DateTime - public static DateTime UNIXUnsignedToDateTime(uint UNIXTimeStamp) + public static DateTime UnixUnsignedToDateTime(uint unixTimeStamp) { - return UNIXEpoch.AddSeconds(UNIXTimeStamp); + return UnixEpoch.AddSeconds(unixTimeStamp); } /// @@ -101,103 +103,95 @@ namespace DiscImageChef /// Seconds since 1st Jan. 1970) /// Nanoseconds /// .NET DateTime - public static DateTime UNIXUnsignedToDateTime(uint seconds, uint nanoseconds) + public static DateTime UnixUnsignedToDateTime(uint seconds, uint nanoseconds) { - return UNIXEpoch.AddSeconds(seconds).AddTicks((long)nanoseconds / 100); + return UnixEpoch.AddSeconds(seconds).AddTicks((long)nanoseconds / 100); } /// /// Converts a UNIX timestamp to a .NET DateTime /// - /// UNIX timestamp (seconds since 1st Jan. 1970) + /// UNIX timestamp (seconds since 1st Jan. 1970) /// .NET DateTime - public static DateTime UNIXUnsignedToDateTime(ulong UNIXTimeStamp) + public static DateTime UnixUnsignedToDateTime(ulong unixTimeStamp) { - return UNIXEpoch.AddSeconds(UNIXTimeStamp); + return UnixEpoch.AddSeconds(unixTimeStamp); } /// /// Converts a High Sierra Format timestamp to a .NET DateTime /// - /// High Sierra Format timestamp + /// High Sierra Format timestamp /// .NET DateTime - public static DateTime HighSierraToDateTime(byte[] VDDateTime) + public static DateTime HighSierraToDateTime(byte[] vdDateTime) { byte[] isotime = new byte[17]; - Array.Copy(VDDateTime, 0, isotime, 0, 16); - return ISO9660ToDateTime(isotime); + Array.Copy(vdDateTime, 0, isotime, 0, 16); + return Iso9660ToDateTime(isotime); } // TODO: Timezone /// /// Converts an ISO9660 timestamp to a .NET DateTime /// - /// ISO9660 timestamp + /// ISO9660 timestamp /// .NET DateTime - public static DateTime ISO9660ToDateTime(byte[] VDDateTime) + public static DateTime Iso9660ToDateTime(byte[] vdDateTime) { - int year, month, day, hour, minute, second, hundredths; byte[] twocharvalue = new byte[2]; byte[] fourcharvalue = new byte[4]; - fourcharvalue[0] = VDDateTime[0]; - fourcharvalue[1] = VDDateTime[1]; - fourcharvalue[2] = VDDateTime[2]; - fourcharvalue[3] = VDDateTime[3]; + fourcharvalue[0] = vdDateTime[0]; + fourcharvalue[1] = vdDateTime[1]; + fourcharvalue[2] = vdDateTime[2]; + fourcharvalue[3] = vdDateTime[3]; DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "year = \"{0}\"", StringHandlers.CToString(fourcharvalue, Encoding.ASCII)); - if(!int.TryParse(StringHandlers.CToString(fourcharvalue, Encoding.ASCII), out year)) year = 0; - // year = Convert.ToInt32(StringHandlers.CToString(fourcharvalue, Encoding.ASCII)); + if(!int.TryParse(StringHandlers.CToString(fourcharvalue, Encoding.ASCII), out int year)) year = 0; - twocharvalue[0] = VDDateTime[4]; - twocharvalue[1] = VDDateTime[5]; + twocharvalue[0] = vdDateTime[4]; + twocharvalue[1] = vdDateTime[5]; DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "month = \"{0}\"", StringHandlers.CToString(twocharvalue, Encoding.ASCII)); - if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out month)) month = 0; - // month = Convert.ToInt32(StringHandlers.CToString(twocharvalue, Encoding.ASCII)); + if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out int month)) month = 0; - twocharvalue[0] = VDDateTime[6]; - twocharvalue[1] = VDDateTime[7]; + twocharvalue[0] = vdDateTime[6]; + twocharvalue[1] = vdDateTime[7]; DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "day = \"{0}\"", StringHandlers.CToString(twocharvalue, Encoding.ASCII)); - if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out day)) day = 0; - // day = Convert.ToInt32(StringHandlers.CToString(twocharvalue, Encoding.ASCII)); + if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out int day)) day = 0; - twocharvalue[0] = VDDateTime[8]; - twocharvalue[1] = VDDateTime[9]; + twocharvalue[0] = vdDateTime[8]; + twocharvalue[1] = vdDateTime[9]; DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "hour = \"{0}\"", StringHandlers.CToString(twocharvalue, Encoding.ASCII)); - if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out hour)) hour = 0; - // hour = Convert.ToInt32(StringHandlers.CToString(twocharvalue, Encoding.ASCII)); + if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out int hour)) hour = 0; - twocharvalue[0] = VDDateTime[10]; - twocharvalue[1] = VDDateTime[11]; + twocharvalue[0] = vdDateTime[10]; + twocharvalue[1] = vdDateTime[11]; DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "minute = \"{0}\"", StringHandlers.CToString(twocharvalue, Encoding.ASCII)); - if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out minute)) minute = 0; - // minute = Convert.ToInt32(StringHandlers.CToString(twocharvalue, Encoding.ASCII)); + if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out int minute)) minute = 0; - twocharvalue[0] = VDDateTime[12]; - twocharvalue[1] = VDDateTime[13]; + twocharvalue[0] = vdDateTime[12]; + twocharvalue[1] = vdDateTime[13]; DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "second = \"{0}\"", StringHandlers.CToString(twocharvalue, Encoding.ASCII)); - if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out second)) second = 0; - // second = Convert.ToInt32(StringHandlers.CToString(twocharvalue, Encoding.ASCII)); + if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out int second)) second = 0; - twocharvalue[0] = VDDateTime[14]; - twocharvalue[1] = VDDateTime[15]; + twocharvalue[0] = vdDateTime[14]; + twocharvalue[1] = vdDateTime[15]; DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "hundredths = \"{0}\"", StringHandlers.CToString(twocharvalue, Encoding.ASCII)); - if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out hundredths)) hundredths = 0; - // hundredths = Convert.ToInt32(StringHandlers.CToString(twocharvalue, Encoding.ASCII)); + if(!int.TryParse(StringHandlers.CToString(twocharvalue, Encoding.ASCII), out int hundredths)) hundredths = 0; DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "decodedDT = new DateTime({0}, {1}, {2}, {3}, {4}, {5}, {6}, DateTimeKind.Unspecified);", year, month, day, hour, minute, second, hundredths * 10); - DateTime decodedDT = new DateTime(year, month, day, hour, minute, second, hundredths * 10, + DateTime decodedDt = new DateTime(year, month, day, hour, minute, second, hundredths * 10, DateTimeKind.Unspecified); - return decodedDT; + return decodedDt; } /// @@ -206,7 +200,7 @@ namespace DiscImageChef /// VMS timestamp (tenths of microseconds since day 0 of the Julian Date) /// .NET DateTime /// C# works in UTC, VMS on Julian Date, some displacement may occur on disks created outside UTC - public static DateTime VMSToDateTime(ulong vmsDate) + public static DateTime VmsToDateTime(ulong vmsDate) { double delta = vmsDate * 0.0001; // Tenths of microseconds to milliseconds, will lose some detail return JulianEpoch.AddMilliseconds(delta); @@ -231,7 +225,7 @@ namespace DiscImageChef /// /// UCSD Pascal timestamp /// .NET DateTime - public static DateTime UCSDPascalToDateTime(short dateRecord) + public static DateTime UcsdPascalToDateTime(short dateRecord) { int year = ((dateRecord & 0xFE00) >> 9) + 1900; int day = (dateRecord & 0x01F0) >> 4; @@ -249,7 +243,7 @@ namespace DiscImageChef /// Date /// Time /// .NET DateTime - public static DateTime DOSToDateTime(ushort date, ushort time) + public static DateTime DosToDateTime(ushort date, ushort time) { int year = ((date & 0xFE00) >> 9) + 1980; int month = (date & 0x1E0) >> 5; @@ -276,7 +270,7 @@ namespace DiscImageChef /// /// CP/M timestamp /// .NET DateTime - public static DateTime CPMToDateTime(byte[] timestamp) + public static DateTime CpmToDateTime(byte[] timestamp) { ushort days = BitConverter.ToUInt16(timestamp, 0); int hours = timestamp[2]; @@ -303,7 +297,7 @@ namespace DiscImageChef /// Hundreds of microseconds /// Microseconds /// - public static DateTime ECMAToDateTime(ushort typeAndTimeZone, short year, byte month, byte day, byte hour, + public static DateTime EcmaToDateTime(ushort typeAndTimeZone, short year, byte month, byte day, byte hour, byte minute, byte second, byte centiseconds, byte hundredsOfMicroseconds, byte microseconds) { @@ -330,11 +324,11 @@ namespace DiscImageChef /// /// Convers a Solaris high resolution timestamp to .NET DateTime /// - /// Solaris high resolution timestamp + /// Solaris high resolution timestamp /// .NET DateTime - public static DateTime UNIXHrTimeToDateTime(ulong HRTimeStamp) + public static DateTime UnixHrTimeToDateTime(ulong hrTimeStamp) { - return UNIXEpoch.AddTicks((long)(HRTimeStamp / 100)); + return UnixEpoch.AddTicks((long)(hrTimeStamp / 100)); } /// @@ -342,21 +336,21 @@ namespace DiscImageChef /// /// OS-9 timestamp /// .NET DateTime - public static DateTime OS9ToDateTime(byte[] date) + public static DateTime Os9ToDateTime(byte[] date) { if(date == null || date.Length != 3 && date.Length != 5) return DateTime.MinValue; - DateTime os9date; + DateTime os9Date; try { - os9date = date.Length == 5 + os9Date = date.Length == 5 ? new DateTime(1900 + date[0], date[1], date[2], date[3], date[4], 0) : new DateTime(1900 + date[0], date[1], date[2], 0, 0, 0); } - catch(ArgumentOutOfRangeException) { os9date = new DateTime(1900, 0, 0, 0, 0, 0); } + catch(ArgumentOutOfRangeException) { os9Date = new DateTime(1900, 0, 0, 0, 0, 0); } - return os9date; + return os9Date; } /// diff --git a/DiscImageChef.Partitions/Sun.cs b/DiscImageChef.Partitions/Sun.cs index 4017a4a31..442066929 100644 --- a/DiscImageChef.Partitions/Sun.cs +++ b/DiscImageChef.Partitions/Sun.cs @@ -246,7 +246,7 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_part[{0}].p_flag = {1} ({2})", i, dkl8.dkl_vtoc.v_part[i].p_flag, (ushort)dkl8.dkl_vtoc.v_part[i].p_flag); DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_timestamp[{0}] = {1}", i, - DateHandlers.UNIXToDateTime(dkl8.dkl_vtoc.v_timestamp[i])); + DateHandlers.UnixToDateTime(dkl8.dkl_vtoc.v_timestamp[i])); } DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_magic = 0x{0:X4}", dkl8.dkl_magic); @@ -275,7 +275,7 @@ namespace DiscImageChef.Partitions }; if(dkl8.dkl_vtoc.v_timestamp[i] != 0) part.Description += - $"\nPartition timestamped on {DateHandlers.UNIXToDateTime(dkl8.dkl_vtoc.v_timestamp[i])}"; + $"\nPartition timestamped on {DateHandlers.UnixToDateTime(dkl8.dkl_vtoc.v_timestamp[i])}"; if(part.Start < imagePlugin.GetSectors() && part.End <= imagePlugin.GetSectors()) partitions.Add(part); @@ -314,7 +314,7 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_part[{0}].p_flag = {1} ({2})", i, dkl16.dkl_vtoc.v_part[i].p_flag, (ushort)dkl16.dkl_vtoc.v_part[i].p_flag); DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_timestamp[{0}] = {1}", i, - DateHandlers.UNIXToDateTime(dkl16.dkl_vtoc.v_timestamp[i])); + DateHandlers.UnixToDateTime(dkl16.dkl_vtoc.v_timestamp[i])); } DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_magic = 0x{0:X4}", dkl16.dkl_magic); @@ -344,7 +344,7 @@ namespace DiscImageChef.Partitions }; if(dkl16.dkl_vtoc.v_timestamp[i] != 0) part.Description += - $"\nPartition timestamped on {DateHandlers.UNIXToDateTime(dkl16.dkl_vtoc.v_timestamp[i])}"; + $"\nPartition timestamped on {DateHandlers.UnixToDateTime(dkl16.dkl_vtoc.v_timestamp[i])}"; if(part.Start < imagePlugin.GetSectors() && part.End <= imagePlugin.GetSectors()) partitions.Add(part); } diff --git a/DiscImageChef.Partitions/VTOC.cs b/DiscImageChef.Partitions/VTOC.cs index 3d94301ab..59dcc7348 100644 --- a/DiscImageChef.Partitions/VTOC.cs +++ b/DiscImageChef.Partitions/VTOC.cs @@ -272,7 +272,7 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("VTOC plugin", "vtocOld.v_part[{0}].p_size = {1}", i, vtocOld.v_part[i].p_size); DicConsole.DebugWriteLine("VTOC plugin", "vtocOld.timestamp[{0}] = {1}", i, - DateHandlers.UNIXToDateTime(vtocOld.timestamp[i])); + DateHandlers.UnixToDateTime(vtocOld.timestamp[i])); } } else @@ -294,7 +294,7 @@ namespace DiscImageChef.Partitions vtoc.v_part[i].p_start); DicConsole.DebugWriteLine("VTOC plugin", "vtoc.v_part[{0}].p_size = {1}", i, vtoc.v_part[i].p_size); DicConsole.DebugWriteLine("VTOC plugin", "vtoc.timestamp[{0}] = {1}", i, - DateHandlers.UNIXToDateTime(vtoc.timestamp[i])); + DateHandlers.UnixToDateTime(vtoc.timestamp[i])); } } @@ -352,7 +352,7 @@ namespace DiscImageChef.Partitions if(parts[i].p_flag.HasFlag(pFlag.V_REMAP)) info += " (alternate sector mapping)"; if(parts[i].p_flag.HasFlag(pFlag.V_RONLY)) info += " (read-only)"; if(timestamps[i] != 0) - info += $" created on {DateHandlers.UNIXToDateTime(timestamps[i])}"; + info += $" created on {DateHandlers.UnixToDateTime(timestamps[i])}"; part.Description = "UNIX slice" + info + ".";