timestamp.go raw

   1  package nostr
   2  
   3  import "time"
   4  
   5  type Timestamp int64
   6  
   7  func Now() Timestamp {
   8  	return Timestamp(time.Now().Unix())
   9  }
  10  
  11  func (t Timestamp) Time() time.Time {
  12  	return time.Unix(int64(t), 0)
  13  }
  14