GNOME Bugzilla – Bug 635031
[datetime] Fix unix epoch handling
Last modified: 2010-11-17 14:56:36 UTC
Currently, GstDateTime provides a gst_date_time_new_from_unix_epoch, which results in a local timezone with the given unix epoch time. IMHO, it should default to UTC, as that's how unix epoch times is represented, or we should provide 2 versions of this function, just like glib gdatetime does. We should fix this before the release to allow us to change API. A quick grep doesn't show it being used in any plugin so far. GDateTime: http://library.gnome.org/devel/glib/stable/glib-GDateTime.html
Created attachment 174676 [details] [review] datetime: Add _from_unix_epoch variants Adds 2 variants for the gst_date_time_from_unix_epoch function, one for UTC and another for local time. API: gst_date_time_new_from_unix_epoch_utc API: gst_date_time_new_from_unix_epoch_local_time Fixes #653031
Created attachment 174677 [details] [review] gst: updating datetime functions Updating datetime _from_unix functions for the new 2 variants (utc/local)
Thanks, please push both those patches. If it wasn't so late in the cycle, I'd suggest making some names shorter like gdatetime's API (ie. unix instead of unix_epoch, and _local instead of _local_time, but it's probably a bit late to change that now..)
I think it is worth changing. Do you think it is too dangerous to do so now?
Pushed. On core: commit 1b27e1e792e99242feadf0f668e284f6f45c2787 Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Wed Nov 17 09:39:34 2010 -0300 datetime: Add _from_unix_epoch variants Adds 2 variants for the gst_date_time_from_unix_epoch function, one for UTC and another for local time. API: gst_date_time_new_from_unix_epoch_utc API: gst_date_time_new_from_unix_epoch_local_time Fixes #653031 https://bugzilla.gnome.org/show_bug.cgi?id=635031 On gst-python: commit 67495d15f88908d5debb8a764bb008ba44d8024d Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Wed Nov 17 09:36:44 2010 -0300 gst: updating datetime functions Updating datetime _from_unix functions for the new 2 variants (utc/local) https://bugzilla.gnome.org/show_bug.cgi?id=635031