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 347614 - Fix for Glib::Date::set_time_current
Fix for Glib::Date::set_time_current
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: general
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2006-07-15 18:06 UTC by Jonathon Jongsma
Modified: 2006-07-16 13:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jonathon Jongsma 2006-07-15 18:06:03 UTC
The implementation of Glib::Date::set_time_current() actually sets the date to Dec 31, 1969.  

I can't actually get CVS to give me a diff, so I'll just explain the change here so that I remember to do it after SVN comes up:

instead of passing in a null time_t variable, e.g.:
  g_date_set_time_t(&gobject_, time_t(0));

We should be passing in the return value of a call to time() passing in NULL, e.g.:
  g_date_set_time_t(&gobject_, time(NULL));
Comment 1 Murray Cumming 2006-07-16 13:36:49 UTC
Ah, I guess I misunderstood the documentation
http://developer.gnome.org/doc/API/2.0/glib/glib-Date-and-Time-Functions.html#g-date-set-time-t
which says 
"To set the value of a date to the current day, you could write:
  g_date_set_time_t (date, time (NULL)); 
"

Feel free to fix this.
Comment 2 Jonathon Jongsma 2006-07-16 13:55:57 UTC
Since svn migration was cancelled, CVS is now back up.  committed:

2006-07-16  Jonathon Jongsma  <jonathon.jongsma@gmail.com>

	* glib/src/date.ccg: fix implementation of Glib::Date::set_time_current() so
	that it doesn't set the date to Dec 31, 1969.