Add a function to init the time code from a GDateTime https://bugzilla.gnome.org/show_bug.cgi?id=778702