ditime

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: BSD-3-Clause Imports: 4 Imported by: 1

README

ditime

travisCI Go Report Card

업무툴 제작에 사용되는 시간관련 Go 라이브러리이다.

Use in go
package main

import (
    "fmt"
    "github.com/digital-idea/ditime"
)

func main() {
    case1 := "2019年1月1日"
    case2 := "2019. 1. 1"
    result1, _ := ditime.ToFullTime(10, case1)
    fmt.Println(result1)
    fmt.Println(result2)
    // 2019-01-01T10:00:00+09:00
    // 2019-01-01T10:00:00+09:00
}
License: BSD 3-Clause License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegexpExcelDaynum = regexp.MustCompile(`^\d{5}$`)

RegexpExcelDaynum 레귤러 익스프레션은 1899-12-31 부터 지난날수에 대한 레귤러 익스프레션이다.

View Source
var RegexpMDD = regexp.MustCompile(`^([1-9])(0?[1-9]|[12][0-9]|3[01])$`) // 101, 110"

RegexpMDD 레귤러 익스프레션은 MDD 패턴의 날짜를 처리한다.

View Source
var RegexpMMDD = regexp.MustCompile(`^(0?[1-9]|1[012])\D\s?(0?[1-9]|[12][0-9]|3[01])\D?\s?$`) // 10/19, 10-19, 10.10. 1.1 1.1. "1. 1."

RegexpMMDD 레귤러 익스프레션은 MM*DD 패턴의 날짜를 처리한다.

View Source
var RegexpMMDDYYYY = regexp.MustCompile(`^(0?[1-9]|1[012])\D\s?(0?[1-9]|[12][0-9]|3[01])\D\s?\d{4}\D?\s?$`) // 10-19-2016, 10/19/2016, 10.19.2016, 10. 19. 2016.

RegexpMMDDYYYY 레귤러 익스프레션은 MM*DD*YYYY 패턴의 날짜를 처리한다.

View Source
var RegexpSix = regexp.MustCompile(`^\d{2}\D\s?(0[1-9]|[12][0-9]|3[01])\D\s?\d{2}\D?\s?$`) // 16-10-19, 16/10/19, 16.10.19, 16.10.19. 16. 10. 10.

RegexpSix 레귤러 익스프레션은 YY*MM*DD* 패턴의 날짜를 처리한다.

View Source
var RegexpYYYYMMDD = regexp.MustCompile(`^\d{4}\D\s?(0?[1-9]|1[012])\D\s?(0?[1-9]|[12][0-9]|3[01])\D?\s?$`) // 2016-10-19, 2016/10/19, 2016.10.19, 2016.10.19. 2016. 10. 10.

RegexpYYYYMMDD 레귤러 익스프레션은 YYYY*MM*DD* 패턴의 날짜를 처리한다.

Functions

func Now

func Now() string

Now 함수는 디지털아이디어에서 사용하는 서비스의 현재 시간을 RFC3339 포멧으로 반환한다.

func Str2time

func Str2time(str string) (time.Time, error)

Str2time 함수는 RFC3339 시간문자열을 Time 자료구조로 바꾼다.

func ToFullTime

func ToFullTime(hourNum int, t string) (string, error)

ToFullTime 함수는 시간(출근시작시간, 퇴근시간등)값과 시간문자를 입력받아서 FullTime(RFC3339)으로 변환한다.

Types

This section is empty.

Jump to

Keyboard shortcuts

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