Is there a simple way to turn a tm structure into a Glib::DateTime object ?
- From: John Emmas <john creativepost co uk>
- To: gtkmm <gtkmm-list gnome org>
- Subject: Is there a simple way to turn a tm structure into a Glib::DateTime object ?
- Date: Fri, 02 Sep 2016 10:12:59 +0100
Suppose I've initialized a tm struct somehow:-
#include <time.h>
struct tm date_and_time;
initialize_date_and_time_somehow (&date_and_time);
Is there a simple way to turn that data into a Glib::DateTime object? I
assume I could do something like this:-
Glib::DateTime tm ( g_date_time_new ( g_time_zone_new (),
date_and_time.tm_year, date_and_time.tm_mon ,
date_and_time.tm_mday, date_and_time.tm_hour ,
date_and_time.tm_min, date_and_time.tm_sec ));
but it all seems a bit convoluted... Have I missed something a lot
simpler? Thanks,
John
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]