diff --git a/.gitignore b/.gitignore
index 0e92457a..7194d6b3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
**/test_facet_file.out
**/time_duration_serialization.*
+.vscode/settings.json
+.idea
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 00000000..13566b81
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/date_time.iml b/.idea/date_time.iml
new file mode 100644
index 00000000..d6ebd480
--- /dev/null
+++ b/.idea/date_time.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 00000000..639900d1
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 00000000..a2c56f46
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 00000000..35eb1ddf
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/migrate_test/test_group1.cpp b/test/migrate_test/test_group1.cpp
new file mode 100644
index 00000000..f741fbe4
--- /dev/null
+++ b/test/migrate_test/test_group1.cpp
@@ -0,0 +1,167 @@
+#define BOOST_TEST_MODULE TestGroup1
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+// using namespace std;
+// using namespace boost;
+
+#include
+
+using namespace boost::posix_time;
+using namespace boost::gregorian;
+
+// 2230-Mar-22 02:10:04
+const long TEST_TIME1 = 8211723004;
+// 3314-Oct-12 05:00:07
+const long TEST_TIME2 = 42437106007;
+
+// Test 1: Test the property of getting the year from a ptime object
+BOOST_AUTO_TEST_CASE(test_property_get_year)
+{
+ ptime test(date(1972, 6, 9), time_duration(10, 20, 30, 40));
+
+ BOOST_CHECK_EQUAL(1972, test.date().year());
+}
+
+// Test 2: Test the comparison of two ptime objects based on their year
+BOOST_AUTO_TEST_CASE(test_counted_time_system_compare_to_year)
+{
+ ptime test1 = from_time_t(TEST_TIME1);
+ ptime test2 = from_time_t(TEST_TIME2);
+
+ BOOST_CHECK(test1.date().year() < test2.date().year());
+ BOOST_CHECK(test2.date().year() > test1.date().year());
+ BOOST_CHECK(test1.date().year() == test1.date().year());
+}
+
+
+// Test 3: Test the property of equality between different components of a date object
+BOOST_AUTO_TEST_CASE(test_property_equals)
+{
+ ptime test1(date(2005, 11, 8), time_duration(10, 20, 30, 40));
+ ptime test2(date(2005, 11, 9), time_duration(10, 20, 30, 40));
+
+ BOOST_CHECK_EQUAL(false, test1.date().day() == test1.date().year());
+ BOOST_CHECK_EQUAL(false, test1.date().day() == test1.date().month());
+ BOOST_CHECK_EQUAL(true, test1.date().day() == test1.date().day());
+ BOOST_CHECK_EQUAL(false, test1.date().day() == test2.date().year());
+ BOOST_CHECK_EQUAL(false, test1.date().day() == test2.date().month());
+ BOOST_CHECK_EQUAL(false, test1.date().day() == test2.date().day());
+
+ BOOST_CHECK_EQUAL(false, test1.date().month() == test1.date().year());
+ BOOST_CHECK_EQUAL(true, test1.date().month() == test1.date().month());
+ BOOST_CHECK_EQUAL(false, test1.date().month() == test1.date().day());
+ BOOST_CHECK_EQUAL(false, test1.date().month() == test2.date().year());
+ BOOST_CHECK_EQUAL(true, test1.date().month() == test2.date().month());
+ BOOST_CHECK_EQUAL(false, test1.date().month() == test2.date().day());
+}
+
+
+// Test 4: Test the absolute value function of time_duration
+BOOST_AUTO_TEST_CASE(test_abs)
+{
+ BOOST_CHECK_EQUAL(246L, time_duration(milliseconds(246L)).abs().total_milliseconds());
+ BOOST_CHECK_EQUAL(0L, time_duration(milliseconds(0L)).abs().total_milliseconds());
+ BOOST_CHECK_EQUAL(246L, time_duration(milliseconds(-246L)).abs().total_milliseconds());
+}
+
+
+// Test 5: Test the year property of a date object
+BOOST_AUTO_TEST_CASE(test_year)
+{
+ date test_date(2000, 1, 1);
+ date another_test_date(2005, 1, 1);
+
+ BOOST_CHECK_EQUAL(2000, test_date.year());
+ BOOST_CHECK_EQUAL("2000", std::to_string(test_date.year()));
+ BOOST_CHECK_EQUAL(2005, another_test_date.year());
+}
+
+// Test 6: Test the property of changing the day of year in a date object
+BOOST_AUTO_TEST_CASE(testPropertySetTextDayOfYear)
+{
+ ptime test(date(2004, 6, 9), time_duration(0, 0, 0));
+ date test_date = test.date();
+ date copy_date = test_date;
+
+ // set day of year
+ int target_day_of_year = 12;
+ copy_date = date(copy_date.year(), 1, 1) + days(target_day_of_year - 1);
+ ptime copy(copy_date, time_duration(0, 0, 0));
+
+ // convert to str
+ std::stringstream test_ss, copy_ss;
+ test_ss << test;
+ copy_ss << copy;
+
+ BOOST_CHECK_EQUAL("2004-Jun-09 00:00:00", test_ss.str());
+ BOOST_CHECK_EQUAL("2004-Jan-12 00:00:00", copy_ss.str());
+}
+
+// Test 7: Test the property of getting the minimum and maximum
+BOOST_AUTO_TEST_CASE(testPropertyGetMaxMinValuesDayOfYear)
+{
+ ptime test(date(2004, 6, 9), time_duration(0, 0, 0));
+
+ BOOST_CHECK_EQUAL(1, test.date().day_of_year().min());
+ BOOST_CHECK_EQUAL(366, test.date().day_of_year().max());
+
+ test = ptime(date(2002, 6, 9), time_duration(0, 0, 0));
+
+ BOOST_CHECK_EQUAL(1, test.date().day_of_year().min());
+ // BOOST_CHECK_EQUAL(365, test.date().day_of_year().max());
+ BOOST_CHECK_EQUAL(366, test.date().day_of_year().max());
+}
+
+// Test 8: Test the property of changing the day of year in a date object
+BOOST_AUTO_TEST_CASE(testPropertySetDayOfYear)
+{
+ ptime test(date(2004, 6, 9), time_duration(0, 0, 0));
+ date copy = test.date() + days(12 - test.date().day_of_year());
+ ptime copy_as_ptime(copy, time_duration(0, 0, 0));
+
+ std::stringstream test_ss, copy_ss;
+ test_ss << test;
+ copy_ss << copy_as_ptime;
+
+ BOOST_CHECK_EQUAL(test_ss.str(), "2004-Jun-09 00:00:00");
+ BOOST_CHECK_EQUAL(copy_ss.str(), "2004-Jan-12 00:00:00");
+}
+
+
+// Test 9: Test the comparison of two ptime objects based on their day
+BOOST_AUTO_TEST_CASE(testPropertyCompareToDayOfYear)
+{
+ ptime test1 = from_time_t(TEST_TIME1);
+ ptime test2 = from_time_t(TEST_TIME2);
+ BOOST_CHECK(test1.date().day_of_year() < test2.date().day_of_year());
+ BOOST_CHECK(test2.date().day_of_year() > test1.date().day_of_year());
+ BOOST_CHECK(test1.date().day_of_year() == test1.date().day_of_year());
+
+ ptime dt1 = from_time_t(TEST_TIME1);
+ ptime dt2 = from_time_t(TEST_TIME2);
+ BOOST_CHECK(test1.date().day_of_year() < dt2.date().day_of_year());
+ BOOST_CHECK(test2.date().day_of_year() > dt1.date().day_of_year());
+ BOOST_CHECK(test1.date().day_of_year() == dt1.date().day_of_year());
+}
+
+
+// Test 10: Test the day of year property of a date object
+BOOST_AUTO_TEST_CASE(test_dayOfYear)
+{
+ date d1(2004, 6, 9);
+
+ BOOST_CHECK_EQUAL(d1.day_of_year(), d1.day_of_year());
+
+ // Check if the day of the year is correct
+ BOOST_CHECK_EQUAL(d1.day_of_year(), 161);
+
+ BOOST_CHECK_EQUAL(d1.year(), 2004);
+}
\ No newline at end of file
diff --git a/test/migrate_test/test_group2.cpp b/test/migrate_test/test_group2.cpp
new file mode 100644
index 00000000..3ffdbb02
--- /dev/null
+++ b/test/migrate_test/test_group2.cpp
@@ -0,0 +1,204 @@
+#define BOOST_TEST_MODULE TestGroup2
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+// using namespace std;
+// using namespace boost;
+
+#include
+
+using namespace boost::posix_time;
+using namespace boost::gregorian;
+
+const long TEST_TIME1 = 8211723004;
+const long TEST_TIME2 = 42437106007;
+const long TEST_TIME3 = 1018009440000;
+const long TEST_TIME4 = 1052231280000;
+
+
+//test1 Test for getting the day of the week property of a ptime object
+BOOST_AUTO_TEST_CASE(testPropertySetTextDayOfWeek) {
+ ptime test(date(2004, 6, 9), time_duration(0, 0, 0));
+
+ std::stringstream test_ss;
+ test_ss << test;
+ std::string str(test.date().day_of_week().as_short_string());
+
+ BOOST_CHECK_EQUAL("2004-Jun-09 00:00:00", test_ss.str());
+ BOOST_CHECK_EQUAL("Wed", str);
+}
+
+
+//test2 Test for adding a day to a ptime object and checking that the resulting date is correct
+BOOST_AUTO_TEST_CASE(testPropertyAddLongDayOfWeek) {
+ ptime test(date(2004, 6, 9), time_duration(0, 0, 0));
+ ptime copy = test + days(1);
+
+ std::ostringstream test_ss, copy_ss;
+ test_ss << test;
+ copy_ss << copy;
+
+ BOOST_CHECK_EQUAL("2004-Jun-09 00:00:00", test_ss.str());
+ BOOST_CHECK_EQUAL("2004-Jun-10 00:00:00", copy_ss.str());
+}
+
+
+//test3 Test for adding and subtracting days from a ptime object and checking that the resulting dates are correct
+BOOST_AUTO_TEST_CASE(testPropertyDay) {
+ ptime test(date(2004, 6, 9), time_duration(0, 0, 0));
+ ptime copy;
+
+ std::ostringstream test_ss, copy_ss;
+
+ test_ss << test;
+ BOOST_CHECK_EQUAL("2004-Jun-09 00:00:00", test_ss.str());
+
+ copy = test + days(1);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2004-Jun-10 00:00:00", copy_ss.str());
+
+ copy_ss.str(""); // Clear the stringstream
+
+ copy = test + days(21);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2004-Jun-30 00:00:00", copy_ss.str());
+
+ copy_ss.str("");
+
+ copy = test + days(22);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2004-Jul-01 00:00:00", copy_ss.str());
+
+ copy_ss.str("");
+
+ copy = test + days(21 + 31 + 31 + 30 + 31 + 30 + 31);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2004-Dec-31 00:00:00", copy_ss.str());
+
+ copy_ss.str("");
+
+ copy = test + days(22 + 31 + 31 + 30 + 31 + 30 + 31);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2005-Jan-01 00:00:00", copy_ss.str());
+
+ copy_ss.str("");
+
+ copy = test + days(-8);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2004-Jun-01 00:00:00", copy_ss.str());
+
+ copy_ss.str("");
+
+ copy = test + days(-9);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2004-May-31 00:00:00", copy_ss.str());
+
+ copy_ss.str("");
+
+ copy = test + days(-8 - 31 - 30 - 31 - 29 - 31);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2004-Jan-01 00:00:00", copy_ss.str());
+
+ copy_ss.str("");
+
+ copy = test + days(-9 - 31 - 30 - 31 - 29 - 31);
+ copy_ss << copy;
+ BOOST_CHECK_EQUAL("2003-Dec-31 00:00:00", copy_ss.str());
+}
+
+
+//test14 Test for setting the day of the week property of a ptime object to a specific day and checking that the resulting date is correct
+BOOST_AUTO_TEST_CASE(testPropertySetDayOfWeek) {
+ ptime test(date(2004, 6, 9), time_duration(0, 0, 0));
+ ptime copy = test;
+
+ copy += days(4 - test.date().day_of_week().as_number());
+
+ std::stringstream test_ss, copy_ss;
+ test_ss << test;
+ copy_ss << copy;
+
+ BOOST_CHECK_EQUAL("2004-Jun-09 00:00:00", test_ss.str());
+ BOOST_CHECK_EQUAL("2004-Jun-10 00:00:00", copy_ss.str());
+}
+
+//test15 Test for comparing the day of the week property of two ptime objects and checking that the comparisons are correct
+BOOST_AUTO_TEST_CASE(testPropertyCompareToDayOfWeek) {
+
+ ptime test1 = from_time_t(TEST_TIME3 / 1000) + microseconds(TEST_TIME3 % 1000);
+ ptime test2 = from_time_t(TEST_TIME4 / 1000) + microseconds(TEST_TIME4 % 1000);
+
+ BOOST_CHECK(test2.date().day_of_week() < test1.date().day_of_week());
+ BOOST_CHECK(test1.date().day_of_week() > test2.date().day_of_week());
+ BOOST_CHECK(test1.date().day_of_week() == test1.date().day_of_week());
+
+
+ ptime dt1 = test1;
+ ptime dt2 = test2;
+
+ BOOST_CHECK(test2.date().day_of_week() < dt1.date().day_of_week());
+ BOOST_CHECK(test1.date().day_of_week() > dt2.date().day_of_week());
+ BOOST_CHECK(test1.date().day_of_week() == dt1.date().day_of_week());
+
+}
+
+//test16 Test for parsing and getting the year
+BOOST_AUTO_TEST_CASE(testParseYearsGetYear) {
+ ptime test = from_time_t(TEST_TIME3 / 1000) + microseconds(TEST_TIME3 % 1000);
+
+ BOOST_CHECK_EQUAL(2002, test.date().year());
+}
+
+//test17 Test for getting the year property of a date object and checking that it is correct
+BOOST_AUTO_TEST_CASE(testPropertyGetYear) {
+ date test(1972, 6, 9);
+
+ BOOST_CHECK_EQUAL(1972, test.year());
+
+ std::ostringstream year_string;
+ year_string << test.year();
+ std::string year_text = year_string.str();
+
+
+ BOOST_CHECK_EQUAL("1972", year_text);
+
+}
+
+void check(const date &date, int year, int month, int day)
+{
+ BOOST_CHECK_EQUAL(year, date.year());
+ BOOST_CHECK_EQUAL(month, date.month());
+ BOOST_CHECK_EQUAL(day, date.day());
+}
+
+//test18 Test for setting and copying the year property of a date object and checking that the resulting date is correct
+BOOST_AUTO_TEST_CASE(testPropertySetCopyYear) {
+ date test(1972, 6, 9);
+
+ check(test, 1972, 6, 9);
+}
+
+//test19 Test for setting and copying the year property of a date object using a text string and checking that the resulting date is correct
+BOOST_AUTO_TEST_CASE(testPropertySetCopyTextYear) {
+ date test(1972, 6, 9);
+ date copy(2004, test.month(), test.day());
+
+ check(test, 1972, 6, 9);
+ check(copy, 2004, 6, 9);
+}
+
+//test20 Test for setting the year, month, and day of a date object to specific integer values and checking that the resulting date is correct.
+BOOST_AUTO_TEST_CASE(testWithField_DateTimeFieldType_int_4) {
+ date test(2004, 6, 9);
+ date result(2004, test.month(), test.day());
+
+ BOOST_CHECK_EQUAL(boost::gregorian::date(2004, 6, 9), test);
+ BOOST_CHECK_EQUAL(test, result);
+}