Timestamp
Package responsible for handling dates with validations and commonly used functions in G3deon applications.
Translations
You can view the documentation of this package in your preferred language:
Frequently Asked Questions
Why not use timestamppb?
This package is an "extension" of the timestamppb package. We have implemented commonly used functions in our applications to improve code maintenance and scalability.
Examples
Use timestamp in your structure for handling dates such as expiration date and creation of a subscription.
import (
"time"
"go.g3deon.com/pkg/timestamp"
)
type Subscription struct {
ExpirationDate *timestamp.Timestamp
// other fields
}
func NewSubscription() *Subscription {
expiration := time.Now().Add(time.Hour * 24 * 14)
return &Subscription{
ExpirationDate: timestamp.FromTime(expiration),
}
}