ktime

package module
v0.0.0-...-4af7bba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 1 Imported by: 4

README

go-kst-time

docker의 리눅스 계열 사용시, KST 기준으로 time 값을 사용할 수 있도록 합니다.

Testing

go test

예시

import (
    ktime "github.com/Sotaneum/go-kst-time"
)
ktime.ToDate(2021, 2, 14, 12, 0)  // 2021-02-14 12:00:00 +0900 KST
ktime.ToDateByTime(time.Now())  // 2021-09-18 03:03:00 +0900 KST
ktime.GetNow()  // 2021-09-18 03:03:00 +0900 KST
ktime.GetNowWithSecond()  // 2021-09-18 03:03:06.010944 +0900 KST
ktime.ToTimestampByTime(12, 0)  // 1631934000
ktime.AddMinuteInTimestamp(ktime.ToTimestampByTime(12, 0), 30)  // 1631935800

MIT License

Copyright (c) 2021 Sotaneum

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMinuteInTimestamp

func AddMinuteInTimestamp(timestamp int64, minute int64) int64

AddMinuteInTimestamp : timestamp 값에 분 값만큼 더해 반환합니다.

func GetNow

func GetNow() time.Time

GetNow : 현재 날짜를 KST로 반환합니다.

func GetNowWithSecond

func GetNowWithSecond() time.Time

GetNowWithSecond : 초단위까지 포함한 값을 반환합니다.

func ToDate

func ToDate(year int, month time.Month, day, hour, min int) time.Time

ToDate : 년, 월, 일, 시, 분을 time.Time 형태로 반환합니다.

func ToDateByTime

func ToDateByTime(t time.Time) time.Time

ToDateByTime : time.Time을 KST로 변경해서 반환합니다.

func ToTimestampByTime

func ToTimestampByTime(hour, min int) int64

ToTimestampByTime : hour, min 값을 현재 날짜로 변경해 timestamp로 반환합니다.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL