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 615901 - [PATCH] add g_time_val_timezone_bias and g_time_val_timezone_name
[PATCH] add g_time_val_timezone_bias and g_time_val_timezone_name
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
2.24.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-04-15 22:31 UTC by Paolo Bonzini
Modified: 2010-05-31 10:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (6.74 KB, patch)
2010-04-15 22:35 UTC, Paolo Bonzini
none Details | Review

Description Paolo Bonzini 2010-04-15 22:31:32 UTC
These are easy under Linux, but require care more code and care under other operating systems.  They can be implemented portably though!

I have separate Windows versions because they can easily support UTF-8, since timezone names are interestingly kept _only_ in Unicode by Windows.

The Windows version should use GetTimeZoneInformationForYear under Vista or later, but I don't have a machine that has it for testing.

An automated test is difficult, here is what I used:

#include <glib.h>

int main(int argc, char **argv)
{
  GDate *date = g_date_new_dmy (14, 4, 2010);
  GTimeVal tv;

  printf ("%d-%d-%d\n", g_date_get_day (date), g_date_get_month (date), g_date_get_year (date));
  g_date_get_time_val (date, &tv);
  g_date_set_time_val (date, &tv);
  printf ("%d-%d-%d\n", g_date_get_day (date), g_date_get_month (date), g_date_get_year (date));
  printf ("%s %d\n", g_time_val_timezone_name (&tv), g_time_val_timezone_bias (&tv));

  g_date_set_month (date, 2);
  g_date_get_time_val (date, &tv);
  g_date_set_time_val (date, &tv);
  printf ("%d-%d-%d\n", g_date_get_day (date), g_date_get_month (date), g_date_get_year (date));
  printf ("%s %d\n", g_time_val_timezone_name (&tv), g_time_val_timezone_bias (&tv));
}
Comment 1 Paolo Bonzini 2010-04-15 22:35:21 UTC
Created attachment 158855 [details] [review]
patch
Comment 2 Behdad Esfahbod 2010-05-29 17:37:33 UTC
See bug 50076.
Comment 3 Paolo Bonzini 2010-05-31 10:54:12 UTC
Seems like it is subsumed by the functionality in there.