GNOME Bugzilla – Bug 679080
datetime: add new_from/to_g_date_time()
Last modified: 2012-07-04 09:26:09 UTC
For apps which make casual recording it is important to keep correct time of record. For example cheese, gstreamer and other. The start time should have different formats: - for filename - to display info - to send a gst_tag_date_time For first two GDateTime and g_date_time_format is just perfect. For gst_tag_date_time we need GstDateTime. gst_date_time_new_from_gdatetime is good for this. But currently it is not accessible as API.
Created attachment 217686 [details] [review] patch adding conversion from/to GstDateTime and GDateTime
I was thinking the same thing this week, as I've made such functions in my projects. I've taken my first stab at creating a patch for core. I've simply exposed gst_date_time_new_from_gdatetime (though I wonder if the public constructor should take ownership instead of a copy), and added gst_date_time_to_gdatetime. I've also tried to add two tests.
Oleksij: these are convenience functions, they don't block anything, you can work around this with less than three lines of code.
commit 0bbeab52cc6b1911c3a0f5fb828dabe7eebf2149 Author: Tim-Philipp Müller <tim@centricular.net> Date: Wed Jul 4 10:23:06 2012 +0100 tests: make checks for from/to_g_date_time() actually work properly commit ba6fad9302a50c8bc194ca8e50cc44baf2aa3764 Author: Joshua M. Doe <josh@joshdoe.com> Date: Fri Jun 29 21:52:47 2012 -0400 datetime: add conversion to/from GDateTime Exposes existing constructor. API: gst_date_time_to_g_date_time() API: gst_date_time_new_from_g_date_time() https://bugzilla.gnome.org/show_bug.cgi?id=679080