diff --git a/birb/birbdatetime.h b/birb/birbdatetime.h
--- a/birb/birbdatetime.h
+++ b/birb/birbdatetime.h
@@ -69,6 +69,37 @@
 BIRB_AVAILABLE_IN_0_1
 void birb_date_time_clear(GDateTime **datetime_ptr);
 
+/**
+ * birb_date_time_compare:
+ * @dt1: (nullable) (transfer none): The pointer to the first
+ *       [type@GLib.DateTime] to compare.
+ * @dt2: (nullable) (transfer none): The pointer to the second
+ *       [type@GLib.DateTime] to compare.
+ *
+ * Compare two [type@GLib.DateTime] objects.
+ *
+ * Returns: -1, 0 or 1 if @dt1 is *less than*, *equal to* or
+ *          *greater than* @dt2.
+ *
+ * Since: 0.2
+ */
+BIRB_AVAILABLE_IN_0_2
+gint birb_date_time_compare(GDateTime *dt1, GDateTime *dt2);
+
+/**
+ * birb_date_time_equal:
+ * @dt1: (nullable) (transfer none): The pointer to the first
+ *       [type@GLib.DateTime] to compare.
+ * @dt2: (nullable) (transfer none): The pointer to the second
+ *       [type@GLib.DateTime] to compare.
+ *
+ * Checks two [type@GLib.DateTime] objects for equality.
+ *
+ * Returns: %TRUE if @dt1 and @dt2 are equal.
+ */
+BIRB_AVAILABLE_IN_0_2
+gboolean birb_date_time_equal(GDateTime *dt1, GDateTime *dt2);
+
 G_END_DECLS
 
 #endif /* BIRB_DATE_TIME_H */
# HG changeset patch
# Node ID 37a6c9956176adde1c3f772624a326d718828f07
# Parent  9d56e51eac1d4cb9241ac22565843a9740abf66f
diff --git a/birb/birbdatetime.c b/birb/birbdatetime.c
--- a/birb/birbdatetime.c
+++ b/birb/birbdatetime.c
@@ -58,3 +58,25 @@
 	g_date_time_unref(*datetime_ptr);
 	*datetime_ptr = NULL;
 }
+
+gint
+birb_date_time_compare(GDateTime *dt1, GDateTime *dt2) {
+	if(dt1 != NULL && dt2 != NULL) {
+		return g_date_time_compare(dt1, dt2);
+	}
+
+	if(dt1 == dt2) {
+		return 0;
+	}
+
+	if(dt1 == NULL) {
+		return -1;
+	} else {
+		return 1;
+	}
+}
+
+gboolean
+birb_date_time_equal(GDateTime *dt1, GDateTime *dt2) {
+	return birb_date_time_compare(dt1, dt2) == 0;
+}
diff --git a/birb/tests/test_date_time.c b/birb/tests/test_date_time.c
--- a/birb/tests/test_date_time.c
+++ b/birb/tests/test_date_time.c
@@ -106,6 +106,80 @@
 }
 
 /******************************************************************************
+ * compare tests
+ *****************************************************************************/
+static void
+test_birb_date_time_compare_null(void) {
+	GDateTime *dt = g_date_time_new_now_utc();
+	gint result;
+
+	result = birb_date_time_compare(dt, NULL);
+	g_assert_cmpint(result, ==, 1);
+
+	result = birb_date_time_compare(NULL, dt);
+	g_assert_cmpint(result, ==, -1);
+
+	result = birb_date_time_compare(NULL, NULL);
+	g_assert_cmpint(result, ==, 0);
+
+	g_date_time_unref(dt);
+}
+
+static void
+test_birb_date_time_compare_nonnull(void) {
+	GTimeZone *tz = g_time_zone_new_utc();
+	GDateTime *now = g_date_time_new_now_utc();
+	GDateTime *then1 = g_date_time_new_from_iso8601("1998-11-18T23:42:00", tz);
+	GDateTime *then2 = g_date_time_new_utc(1998, 11, 18, 23, 42, 0.0);
+	gint result;
+
+	result = birb_date_time_compare(now, then1);
+	g_assert_cmpint(result, ==, 1);
+
+	result = birb_date_time_compare(then1, now);
+	g_assert_cmpint(result, ==, -1);
+
+	result = birb_date_time_compare(then1, then2);
+	g_assert_cmpint(result, ==, 0);
+
+	g_date_time_unref(now);
+	g_date_time_unref(then1);
+	g_date_time_unref(then2);
+	g_time_zone_unref(tz);
+}
+
+/******************************************************************************
+ * equal tests
+ *****************************************************************************/
+static void
+test_birb_date_time_equal_null(void) {
+	GDateTime *dt = g_date_time_new_now_utc();
+
+	g_assert_false(birb_date_time_equal(dt, NULL));
+	g_assert_false(birb_date_time_equal(NULL, dt));
+	g_assert_true(birb_date_time_equal(NULL, NULL));
+
+	g_date_time_unref(dt);
+}
+
+static void
+test_birb_date_time_equal_nonnull(void) {
+	GTimeZone *tz = g_time_zone_new_utc();
+	GDateTime *now = g_date_time_new_now_utc();
+	GDateTime *then1 = g_date_time_new_from_iso8601("1998-11-18T23:42:00", tz);
+	GDateTime *then2 = g_date_time_new_utc(1998, 11, 18, 23, 42, 0.0);
+
+	g_assert_true(birb_date_time_equal(then1, then2));
+	g_assert_false(birb_date_time_equal(now, then2));
+	g_assert_false(birb_date_time_equal(then1, now));
+
+	g_date_time_unref(now);
+	g_date_time_unref(then1);
+	g_date_time_unref(then2);
+	g_time_zone_unref(tz);
+}
+
+/******************************************************************************
  * Main
  *****************************************************************************/
 gint
@@ -125,5 +199,13 @@
 	g_test_add_func("/date-time/clear/nonnull",
 	                test_birb_date_time_clear_nonnull);
 
+	g_test_add_func("/date-time/compare/null", test_birb_date_time_compare_null);
+	g_test_add_func("/date-time/compare/nonnull",
+	                test_birb_date_time_compare_nonnull);
+
+	g_test_add_func("/date-time/equal/null", test_birb_date_time_equal_null);
+	g_test_add_func("/date-time/equal/nonnull",
+	                test_birb_date_time_equal_nonnull);
+
 	return g_test_run();
 }
