Skip to content

Latest commit

Β 

History

History
84 lines (58 loc) Β· 2.09 KB

File metadata and controls

84 lines (58 loc) Β· 2.09 KB

SherryTime library

SherryTime is a time utility package written in Go. It provides a simple API for handling time zones, time formatting, UUID generation, and more.

πŸ“¦ Installation

Install using go get:

go get github.com/asccclass/sherrytime

If you want to use the UUID feature, also install:

go get github.com/google/uuid

πŸš€ Usage

package main

import (
    "fmt"
    "log"

    "github.com/asccclass/sherrytime"
)

func main() {
    // Initialize SherryTime with time zone Asia/Taipei and date-time separator "-"
    st := sherrytime.NewSherryTime("Asia/Taipei", "-")

    // Get current time
    log.Printf("Current Time: %v", st.Now())

    // Get today's date
    fmt.Println("Today's Date:", st.Today())

    // Generate a new UUID
    fmt.Println("Generated UUID:", st.NewUUID())
}

πŸ§ͺ Testing

Run tests using Makefile:

make test

πŸ“š Features

Function Name Return Type Description
Today() string Get today's date
Now() string Get current time
NewUUID() string Generate a new UUID

πŸ“ File Structure

File Name Description
sherrytime.go Main feature implementation
sherrytime_test.go Unit tests
sherrytimeformat.go Time formatting functions
sherrytimegoogle.go Google-related time features
sherrytimenanoid.go Generate unique ID using NanoID
sherrytimeuuid.go Generate unique ID using UUID
hseb.go Additional helper functions
makefile Automation scripts for build/test

πŸ“„ License

This project is licensed under the MIT License.

πŸ™‹β€β™‚οΈ Author

Developed and maintained by LIU CHIH HAN (asccclass).


For more information, visit the asccclass page.