After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635031 - [datetime] Fix unix epoch handling
[datetime] Fix unix epoch handling
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal blocker
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 634928
 
 
Reported: 2010-11-16 22:01 UTC by Thiago Sousa Santos
Modified: 2010-11-17 14:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
datetime: Add _from_unix_epoch variants (9.40 KB, patch)
2010-11-17 12:59 UTC, Thiago Sousa Santos
committed Details | Review
gst: updating datetime functions (1.08 KB, patch)
2010-11-17 13:12 UTC, Thiago Sousa Santos
committed Details | Review

Description Thiago Sousa Santos 2010-11-16 22:01:46 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
Comment 1 Thiago Sousa Santos 2010-11-17 12:59:08 UTC
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
Comment 2 Thiago Sousa Santos 2010-11-17 13:12:13 UTC
Created attachment 174677 [details] [review]
gst: updating datetime functions

Updating datetime _from_unix functions for the new 2 variants (utc/local)
Comment 3 Tim-Philipp Müller 2010-11-17 13:22:22 UTC
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..)
Comment 4 Thiago Sousa Santos 2010-11-17 13:37:10 UTC
I think it is worth changing. Do you think it is too dangerous to do so now?
Comment 5 Thiago Sousa Santos 2010-11-17 14:56:07 UTC
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