Exemplo n.º 1
0
/* 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
}
Exemplo n.º 2
0
// 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)
}