types.go 528 B

1234567891011121314151617181920
  1. // Discordgo - Discord bindings for Go
  2. // Available at https://github.com/bwmarrin/discordgo
  3. // Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
  4. // Use of this source code is governed by a BSD-style
  5. // license that can be found in the LICENSE file.
  6. // This file contains custom types, currently only a timestamp wrapper.
  7. package discordgo
  8. import (
  9. "time"
  10. )
  11. type Timestamp string
  12. func (t Timestamp) Parse() (time.Time, error) {
  13. return time.Parse("2006-01-02T15:04:05.000000-07:00", string(t))
  14. }