/* Get the timestamp (seconds since the epoch) of 'message'. * * Return status: * * NOTMUCH_STATUS_SUCCESS: Timestamp successfully retrieved * * NOTMUCH_STATUS_NULL_POINTER: The 'message' argument is NULL * */ func (self *Message) GetDate() (int64, Status) { if self.message == nil { return -1, STATUS_NULL_POINTER } timestamp := C.notmuch_message_get_date(self.message) return int64(timestamp), STATUS_SUCCESS }
// Date returns the date of the message. func (m *Message) Date() time.Time { ctime := C.notmuch_message_get_date(m.toC()) return time.Unix(int64(ctime), 0) }