Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.79 KB

README.md

File metadata and controls

47 lines (34 loc) · 1.79 KB

Tests GitHub release MIT license codecov lint workflow help wanted

bublyk

The package introduces the Date type, specifically designed for instances where only the date in UTC location is required, without the need for time details. In comparison to the time.Time type, Date offers several advantages:

  • It consumes significantly less memory.
  • It eliminates the need for boilerplate code when working with dates.
  • It allows for straightforward comparisons using operators such as >, <, and others.

Usage

package main

import (
	"fmt"
	"time"

	"github.com/kaatinga/bublyk"
)

func main() {
	// Create a new Date instance
	date := bublyk.Now()

	// Print the current date
	fmt.Println(date)

	// Create a new Date instance from a time.Time instance
	var t = time.Now()
	date2 := bublyk.NewDateFromTime(&t)

	// Print the current date
	fmt.Println(date2)

	// Compare two Date instances
	fmt.Println(date > date2)
}

Will be happy to everyone who want to participate in the work on the bublyk package.