From 0067fe79b2fcb9bd570ba3ce82d84edda429f054 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 26 Oct 2020 16:21:53 +0800 Subject: [PATCH] 1 --- init.go | 4 ++++ sysutils.go | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 init.go diff --git a/init.go b/init.go new file mode 100644 index 0000000..5c0487b --- /dev/null +++ b/init.go @@ -0,0 +1,4 @@ +package q5 + +func init() { +} diff --git a/sysutils.go b/sysutils.go index e88aa58..5281c1b 100644 --- a/sysutils.go +++ b/sysutils.go @@ -8,10 +8,18 @@ import ( "reflect" ) -func GetDaySeconds(seconds int64) int64 { +func GetTimeZone() int64 { return 0 } +func GetDaySeconds(seconds int64) int64 { + return GetDaySecondsEx(seconds, GetTimeZone()) +} + +func GetDaySecondsEx(seconds int64, timeZone int64) int64 { + return ((seconds + timeZone * 3600)/3600/24 + 1) * 3600 * 24 - 3600 * timeZone; +} + func GetTickCount() int64 { return time.Now().UnixNano() / 1e6 }