summaryrefslogtreecommitdiff
path: root/gdata/tests/youtube.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdata/tests/youtube.c')
-rw-r--r--gdata/tests/youtube.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdata/tests/youtube.c b/gdata/tests/youtube.c
index 5fefbaf8..e8b2ea30 100644
--- a/gdata/tests/youtube.c
+++ b/gdata/tests/youtube.c
@@ -1537,13 +1537,16 @@ test_comment_properties_parent_comment_uri (void)
static gchar *
build_this_week_date_str (void)
{
- GTimeVal tv;
+ GDateTime *tv, *tv2;
+ gchar *ret;
- g_get_current_time (&tv);
- tv.tv_sec -= 7 * 24 * 60 * 60; /* this week */
- tv.tv_usec = 0; /* pointless accuracy */
+ tv = g_date_time_new_from_unix_utc (g_get_real_time () / G_USEC_PER_SEC);
+ tv2 = g_date_time_add_weeks (tv, -1);
+ g_date_time_unref (tv);
- return g_time_val_to_iso8601 (&tv);
+ ret = g_date_time_format_iso8601 (tv2);
+ g_date_time_unref (tv2);
+ return ret;
}
static void