dateutils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecimalAgeAsOf

func DecimalAgeAsOf(birthDate time.Time, asOfDate time.Time) float64

func FormatSqlDateTime

func FormatSqlDateTime(dateTime time.Time) string

func GetAgeAsOf

func GetAgeAsOf(birthDate time.Time, asOfDate time.Time) int

GetCurrentAge calculates age in years for a given birthdate, as of a specific date. Note, this function is not timezone aware

func GetBirthdayForAge

func GetBirthdayForAge(birthDate time.Time, targetAge int) time.Time

func GetCurrentAge

func GetCurrentAge(birthDate time.Time) int

GetCurrentAge calculates age in years for a given birthdate, as of right now. Note, this function is not timezone aware

func GetDateForAge

func GetDateForAge(birthDate time.Time, targetAge float64) time.Time

func GetMaxEndDate

func GetMaxEndDate() time.Time

func ParseIsoString

func ParseIsoString(input string) (time.Time, error)

func StartOfNextMonth

func StartOfNextMonth(fromDate time.Time, inclusive bool) time.Time

Returns the first of the next month, after the provided fromDate, ignoring the time. If inclusive == true and the fromDate is the first of the month, it will return the fromDate. If inclusive == false and the fromDate is the first of the month, it will return fromDate + 1 month.

func ToEndOfDay

func ToEndOfDay(dateTime time.Time) time.Time

func ToStartOfDay

func ToStartOfDay(dateTime time.Time) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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