You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
565 B

package ktmtrainbot
import (
"net/http"
"time"
"github.com/go-chi/render"
)
// Get Current Server Time
// @Summary Get current server time
// @Description Description
// @Tags Info
// @Produce json
// @Success 200 {object} ServerTimeResponse
// @Failure 400 {object} common.ErrResponse
// @Router /api/v1/ktmtrainbot/current-time [get]
func (env *Env) getCurrentTime(w http.ResponseWriter, r *http.Request) {
timeNow := time.Now()
var res ServerTimeResponse
res.ServerLocalTime = timeNow.In(time.Local).Format(time.RFC1123Z)
render.Render(w, r, &res)
}