[jana] jana-ecal-time: Add a jana_ecal_time_to_time_t accessor function
- From: Rob Bradford <rbradford src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [jana] jana-ecal-time: Add a jana_ecal_time_to_time_t accessor function
- Date: Tue, 15 Dec 2009 13:46:54 +0000 (UTC)
commit 9ec1da8a534e87a83a6d729b48a41ca7b9cfb7b7
Author: Rob Bradford <rob linux intel com>
Date: Tue Dec 15 12:35:55 2009 +0000
jana-ecal-time: Add a jana_ecal_time_to_time_t accessor function
libjana-ecal/jana-ecal-time.c | 16 ++++++++++++++++
libjana-ecal/jana-ecal-time.h | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/libjana-ecal/jana-ecal-time.c b/libjana-ecal/jana-ecal-time.c
index 44a5b10..a7cda87 100644
--- a/libjana-ecal/jana-ecal-time.c
+++ b/libjana-ecal/jana-ecal-time.c
@@ -622,3 +622,19 @@ jana_ecal_time_get_location (JanaEcalTime *self)
(icaltimezone *)priv->time->zone);
return location ? location : "UTC";
}
+
+/**
+ * jana_ecal_time_to_time_t
+ * @self: A #JanaEcalTime
+ *
+ * Converts a #JanaEcalTime to time_t type.
+ *
+ * Returns: A time_t representation of the time.
+ */
+time_t
+jana_ecal_time_to_time_t (JanaEcalTime *self)
+{
+ JanaEcalTimePrivate *priv = TIME_PRIVATE (self);
+
+ return icaltime_as_timet (*priv->time);
+}
diff --git a/libjana-ecal/jana-ecal-time.h b/libjana-ecal/jana-ecal-time.h
index bed62e5..b9480a3 100644
--- a/libjana-ecal/jana-ecal-time.h
+++ b/libjana-ecal/jana-ecal-time.h
@@ -64,6 +64,7 @@ JanaTime *jana_ecal_time_new_from_ecaltime (ECalComponentDateTime *dt);
void jana_ecal_time_set_location (JanaEcalTime *self, const gchar *location);
const gchar *jana_ecal_time_get_location (JanaEcalTime *self);
+time_t jana_ecal_time_to_time_t (JanaEcalTime *self);
#endif /* JANA_ECAL_TIME_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]