Advertisement
arxeiss

Saving and loading datetime

May 14th, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.20 KB | None | 0 0
  1. // Saving
  2. var start int64 = 0
  3. if !campaign.Start.IsZero() {
  4.     start = campaign.Start.Unix()
  5. }
  6.  
  7. // Loading
  8. var start time.Time
  9. if startFromDatabase > 0 {
  10.     start = time.Unix(startFromDatabase, 0)
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement