* @day: the day of the Gregorian month
* @hour: the hour of the day
* @minute: the minute of the hour
- * @second: the second of the minute
+ * @second: the second of the minute, with eventual fractionary parts
* @time_zone: (allow-none): a #GTimeZone, or %NULL for UTC
*
* Creates a new #GDateTime using the date and times in the Gregorian
gint day,
gint hour,
gint minute,
- gint second,
+ gdouble second,
const GTimeZone *time_zone)
{
GDateTime *dt;
g_return_val_if_fail (hour >= 0 && hour < 24, NULL);
g_return_val_if_fail (minute >= 0 && minute < 60, NULL);
- g_return_val_if_fail (second >= 0 && second <= 60, NULL);
+ g_return_val_if_fail (second >= 0.0 && second <= 60.0, NULL);
dt = g_date_time_new ();
dt->days = date_to_proleptic_gregorian (year, month, day);
gint day,
gint hour,
gint minute,
- gint second,
+ gdouble second,
const GTimeZone *time_zone);
GDateTime * g_date_time_ref (GDateTime *datetime);
dt2 = g_date_time_new_full (2000, 1, 1, 0, 0, 0, NULL);
g_assert_cmpint (0, ==, g_date_time_compare (dt1, dt2));
g_date_time_unref (dt2);
-
g_date_time_unref (dt1);
}
dt = g_date_time_new_from_timeval (&tv);
g_assert_cmpint ((tv.tv_usec / 1000), ==, g_date_time_get_millisecond (dt));
g_date_time_unref (dt);
+
+ dt = g_date_time_new_full (2010, 9, 15, 12, 0, 0.1234, NULL);
+ g_assert_cmpint (123, ==, g_date_time_get_millisecond (dt));
+ g_assert_cmpint (123400, ==, g_date_time_get_microsecond (dt));
+ g_date_time_unref (dt);
}
static void