GITLAB

Hermes / api-game

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • api-game_qianyi
  • util
  • ztime
  • external.go
  • efb4f5c8   feat✨:排行榜结算方式改为每天结算 Browse Code »
    王家文
    2024-05-11 11:31:55 +0800  
external.go 316 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
package ztime

import (
	"strconv"
	"strings"
)

func TimeClock(text string) (hour, min, sec int) {
	list := strings.Split(text, ":")
	if len(list) >= 1 {
		hour, _ = strconv.Atoi(list[0])
	}
	if len(list) >= 2 {
		min, _ = strconv.Atoi(list[1])
	}
	if len(list) >= 3 {
		sec, _ = strconv.Atoi(list[2])
	}
	return
}