Skip to content

nhatthm/timeparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time Parser for Golang

GitHub Releases Build Status codecov Go Report Card GoDevDoc Donate

timeparser provides flexibility in parsing time from string for Golang. It allows either RFC3339 or YMD.

Prerequisites

  • Go >= 1.17

Install

go get go.nhat.io/timeparser

Usage

func Parse(s string) (time.Time, error)

Parse a time in string to time.Time. s could be RFC3339 or YMD.

func ParsePeriod(from, to string) (start *time.Time, end *time.Time, err error)

Parse a time period from string to time.Time.

from and to could be RFC3339 or YMD. It is nil if the string is empty.

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

Paypal donation

paypal

       or scan this