print.go 520 B

12345678910111213141516171819202122
  1. package api
  2. import (
  3. "fmt"
  4. "time"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func Printr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
  8. loc, _ := time.LoadLocation("Local")
  9. date := time.Now().Format("2006-01-02")
  10. startDate := date + " 00:00:00"
  11. startTime, _ := time.ParseInLocation("2006-01-02 15:04:05", startDate, loc)
  12. endDate := date + " 23:59:59"
  13. endTime, _ := time.ParseInLocation("2006-01-02 15:04:05", endDate, loc)
  14. fmt.Println(startTime.Unix())
  15. fmt.Println(endTime.Unix())
  16. return "success", nil
  17. }