View Issue Details

IDProjectCategoryView StatusLast Update
0001614OpenMPTFile Format Supportpublic2022-07-14 15:09
Reportermanx Assigned Tomanx  
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
Product VersionOpenMPT 1.31.00.* (current testing) 
Target VersionOpenMPT 1.?? (long term goals) 
Summary0001614: store Edit History in UTC
Description

Store Edit History and related timestamp metadata in UTC instead of unspecified local time zone.

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Relationships

parent of 0001572 resolvedmanx use more std::chrono and less ctime 
child of 0000865 new Revised MPTM format - idea pool 

Activities

manx

manx

2022-07-09 13:41

administrator   ~0005252

[Mod] Enable MPT_TIME_UTC_ON_DISK feature flag.
[Mod] IT/MPTM: Dates are now written in UTC. Loading decides by looking at m_dwLastSavedWithVersion how to interpret dates. After loading, all dates with Local timezone are converted into UTC timezone, dates with Unspecified timezone are kept as is.
[Mod] OpenMPT: Version is now 1.31.00.13
chrono-v17.patch (3,289 bytes)   
Index: common/BuildSettings.h
===================================================================
--- common/BuildSettings.h	(revision 17653)
+++ common/BuildSettings.h	(working copy)
@@ -321,11 +321,8 @@
 
 #endif
 
-#define MPT_TIME_UTC_ON_DISK 0
-#define MPT_TIME_UTC_ON_DISK_VERSION MPT_V("1.31.00.13")
 
 
-
 // fixing stuff up
 
 #if defined(MPT_BUILD_ANALYZED) || defined(MPT_BUILD_CHECKED) 
Index: common/versionNumber.h
===================================================================
--- common/versionNumber.h	(revision 17653)
+++ common/versionNumber.h	(working copy)
@@ -18,6 +18,6 @@
 #define VER_MAJORMAJOR  1
 #define VER_MAJOR      31
 #define VER_MINOR      00
-#define VER_MINORMINOR 12
+#define VER_MINORMINOR 13
 
 OPENMPT_NAMESPACE_END
Index: soundlib/Load_it.cpp
===================================================================
--- soundlib/Load_it.cpp	(revision 17653)
+++ soundlib/Load_it.cpp	(working copy)
@@ -1278,19 +1278,11 @@
 	m_modFormat.type = (GetType() == MOD_TYPE_MPT) ? U_("mptm") : U_("it");
 	m_modFormat.madeWithTracker = std::move(madeWithTracker);
 	m_modFormat.charset = m_dwLastSavedWithVersion ? mpt::Charset::Windows1252 : mpt::Charset::CP437;
-#if MPT_TIME_UTC_ON_DISK
 #ifdef MODPLUG_TRACKER
-	m_modFormat.timezone = (m_dwLastSavedWithVersion && (m_dwLastSavedWithVersion >= MPT_TIME_UTC_ON_DISK_VERSION)) ? mpt::Date::LogicalTimezone::UTC : mpt::Date::LogicalTimezone::Local;
+	m_modFormat.timezone = (m_dwLastSavedWithVersion && (m_dwLastSavedWithVersion >= MPT_V("1.31.00.13"))) ? mpt::Date::LogicalTimezone::UTC : mpt::Date::LogicalTimezone::Local;
 #else
-	m_modFormat.timezone = (m_dwLastSavedWithVersion && (m_dwLastSavedWithVersion >= MPT_TIME_UTC_ON_DISK_VERSION)) ? mpt::Date::LogicalTimezone::UTC : mpt::Date::LogicalTimezone::Unspecified;
+	m_modFormat.timezone = (m_dwLastSavedWithVersion && (m_dwLastSavedWithVersion >= MPT_V("1.31.00.13"))) ? mpt::Date::LogicalTimezone::UTC : mpt::Date::LogicalTimezone::Unspecified;
 #endif
-#else
-#ifdef MODPLUG_TRACKER
-	m_modFormat.timezone = mpt::Date::LogicalTimezone::Local;
-#else
-	m_modFormat.timezone = mpt::Date::LogicalTimezone::Unspecified;
-#endif
-#endif
 
 	return true;
 }
Index: soundlib/Sndfile.cpp
===================================================================
--- soundlib/Sndfile.cpp	(revision 17653)
+++ soundlib/Sndfile.cpp	(working copy)
@@ -514,7 +514,6 @@
 		InitializeGlobals();
 		m_visitedRows.Initialize(true);
 		m_dwCreatedWithVersion = Version::Current();
-#if MPT_TIME_UTC_ON_DISK
 #ifdef MODPLUG_TRACKER
 		if(GetType() & MOD_TYPE_IT)
 		{
@@ -532,16 +531,8 @@
 			m_modFormat.timezone = mpt::Date::LogicalTimezone::Unspecified;
 		}
 #endif // MODPLUG_TRACKER
-#else
-#ifdef MODPLUG_TRACKER
-		m_modFormat.timezone = mpt::Date::LogicalTimezone::Local;
-#else // !MODPLUG_TRACKER
-		m_modFormat.timezone = mpt::Date::LogicalTimezone::Unspecified;
-#endif // MODPLUG_TRACKER
-#endif
 	}
 
-#if MPT_TIME_UTC_ON_DISK
 #ifdef MODPLUG_TRACKER
 	// convert timestamps to UTC
 	if(m_modFormat.timezone == mpt::Date::LogicalTimezone::Local)
@@ -556,7 +547,6 @@
 		m_modFormat.timezone = mpt::Date::LogicalTimezone::UTC;
 	}
 #endif // MODPLUG_TRACKER
-#endif
 
 	// Adjust channels
 	const auto muteFlag = GetChannelMuteFlag();
chrono-v17.patch (3,289 bytes)   
manx

manx

2022-07-14 15:09

administrator   ~0005257

[Mod] Enable MPT_TIME_UTC_ON_DISK feature flag.
[Mod] IT/MPTM: Dates are now written in UTC. Loading decides by looking at m_dwLastSavedWithVersion how to interpret dates. After loading, all dates with Local timezone are converted into UTC timezone, dates with Unspecified timezone are kept as is.
[Mod] OpenMPT: Version is now 1.31.00.13
mptm-it-edithistory-utc-v2.patch (3,289 bytes)   
Index: common/BuildSettings.h
===================================================================
--- common/BuildSettings.h	(revision 17665)
+++ common/BuildSettings.h	(working copy)
@@ -321,11 +321,8 @@
 
 #endif
 
-#define MPT_TIME_UTC_ON_DISK 0
-#define MPT_TIME_UTC_ON_DISK_VERSION MPT_V("1.31.00.13")
 
 
-
 // fixing stuff up
 
 #if defined(MPT_BUILD_ANALYZED) || defined(MPT_BUILD_CHECKED) 
Index: common/versionNumber.h
===================================================================
--- common/versionNumber.h	(revision 17665)
+++ common/versionNumber.h	(working copy)
@@ -18,6 +18,6 @@
 #define VER_MAJORMAJOR  1
 #define VER_MAJOR      31
 #define VER_MINOR      00
-#define VER_MINORMINOR 12
+#define VER_MINORMINOR 13
 
 OPENMPT_NAMESPACE_END
Index: soundlib/Load_it.cpp
===================================================================
--- soundlib/Load_it.cpp	(revision 17665)
+++ soundlib/Load_it.cpp	(working copy)
@@ -1278,19 +1278,11 @@
 	m_modFormat.type = (GetType() == MOD_TYPE_MPT) ? U_("mptm") : U_("it");
 	m_modFormat.madeWithTracker = std::move(madeWithTracker);
 	m_modFormat.charset = m_dwLastSavedWithVersion ? mpt::Charset::Windows1252 : mpt::Charset::CP437;
-#if MPT_TIME_UTC_ON_DISK
 #ifdef MODPLUG_TRACKER
-	m_modFormat.timezone = (m_dwLastSavedWithVersion && (m_dwLastSavedWithVersion >= MPT_TIME_UTC_ON_DISK_VERSION)) ? mpt::Date::LogicalTimezone::UTC : mpt::Date::LogicalTimezone::Local;
+	m_modFormat.timezone = (m_dwLastSavedWithVersion && (m_dwLastSavedWithVersion >= MPT_V("1.31.00.13"))) ? mpt::Date::LogicalTimezone::UTC : mpt::Date::LogicalTimezone::Local;
 #else
-	m_modFormat.timezone = (m_dwLastSavedWithVersion && (m_dwLastSavedWithVersion >= MPT_TIME_UTC_ON_DISK_VERSION)) ? mpt::Date::LogicalTimezone::UTC : mpt::Date::LogicalTimezone::Unspecified;
+	m_modFormat.timezone = (m_dwLastSavedWithVersion && (m_dwLastSavedWithVersion >= MPT_V("1.31.00.13"))) ? mpt::Date::LogicalTimezone::UTC : mpt::Date::LogicalTimezone::Unspecified;
 #endif
-#else
-#ifdef MODPLUG_TRACKER
-	m_modFormat.timezone = mpt::Date::LogicalTimezone::Local;
-#else
-	m_modFormat.timezone = mpt::Date::LogicalTimezone::Unspecified;
-#endif
-#endif
 
 	return true;
 }
Index: soundlib/Sndfile.cpp
===================================================================
--- soundlib/Sndfile.cpp	(revision 17665)
+++ soundlib/Sndfile.cpp	(working copy)
@@ -514,7 +514,6 @@
 		InitializeGlobals();
 		m_visitedRows.Initialize(true);
 		m_dwCreatedWithVersion = Version::Current();
-#if MPT_TIME_UTC_ON_DISK
 #ifdef MODPLUG_TRACKER
 		if(GetType() & MOD_TYPE_IT)
 		{
@@ -532,16 +531,8 @@
 			m_modFormat.timezone = mpt::Date::LogicalTimezone::Unspecified;
 		}
 #endif // MODPLUG_TRACKER
-#else
-#ifdef MODPLUG_TRACKER
-		m_modFormat.timezone = mpt::Date::LogicalTimezone::Local;
-#else // !MODPLUG_TRACKER
-		m_modFormat.timezone = mpt::Date::LogicalTimezone::Unspecified;
-#endif // MODPLUG_TRACKER
-#endif
 	}
 
-#if MPT_TIME_UTC_ON_DISK
 #ifdef MODPLUG_TRACKER
 	// convert timestamps to UTC
 	if(m_modFormat.timezone == mpt::Date::LogicalTimezone::Local)
@@ -556,7 +547,6 @@
 		m_modFormat.timezone = mpt::Date::LogicalTimezone::UTC;
 	}
 #endif // MODPLUG_TRACKER
-#endif
 
 	// Adjust channels
 	const auto muteFlag = GetChannelMuteFlag();

Issue History

Date Modified Username Field Change
2022-07-09 13:41 manx New Issue
2022-07-09 13:41 manx Status new => assigned
2022-07-09 13:41 manx Assigned To => manx
2022-07-09 13:41 manx Note Added: 0005252
2022-07-09 13:41 manx File Added: chrono-v17.patch
2022-07-09 13:41 manx Status assigned => confirmed
2022-07-09 13:42 manx Relationship added parent of 0001572
2022-07-10 10:57 manx Relationship added child of 0000865
2022-07-10 10:58 manx Target Version OpenMPT 1.31 / libopenmpt 0.7 (goals) => OpenMPT 1.?? (long term goals)
2022-07-14 15:09 manx Note Added: 0005257
2022-07-14 15:09 manx File Added: mptm-it-edithistory-utc-v2.patch
2022-07-14 15:09 manx Status confirmed => new