Golang how to get date time now substract one hour and format to YYYY-MM-DD HH:ii:ss

0
120
views

  1. Line 10, get time now.
  2. Line 13, now add -1 hour, and same mean with substract with one hour.
  3. Line 14, fomat to YYYY-MM-DD HH:ii:ss

Reference:
https://play.golang.org/p/L6LhSl6ebOx

LEAVE A REPLY

Please enter your name here
Please enter your comment!