timetools

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 2 Imported by: 4

README

timetools

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeDateSeparator added in v0.0.5

func ChangeDateSeparator(date, separator string) (new_date string, err error)

verifica y cambia formato de fecha según separador ingresado ej:2006-01-02 "/" = 2006/01/02

func CheckDateExists added in v0.0.5

func CheckDateExists(date string) error

verifica formato 2006-01-02 y si los rangos de el año, mes y dia son validos y si los Dias existen según año y mes bisiesto

func CorrectFormatDate added in v0.0.5

func CorrectFormatDate(date string) error

verifica formato y valores numéricos en sus posiciones ej: "2006-01-02"

func DayOfYear added in v0.0.3

func DayOfYear(year, month, day int) (int, error)

DayOfYear calcula el día del año para una fecha dada y retorna un error si la fecha no es válida.

func GetAdjustedBirthDay added in v0.0.3

func GetAdjustedBirthDay(yearBirth, dayOfYearBirth, yearNow, dayOfYearNow int) int

Obtiene la fecha de nacimiento ajustada para solucionar las diferencias de los años bisiestos.

func HourArrayToMap

func HourArrayToMap(hour_in []string) (out map[string]string)

ej: "08:00" -> "08:00": "8:00"

func HowOldAreYou added in v0.0.3

func HowOldAreYou(birthday string, time model.TimeNow) (int, error)

obtener edad en formato numero ej: (birthday) "2006-01-02"

func IsLeap added in v0.0.3

func IsLeap(year int) bool

es bisiesto este año?

func MonthDays added in v0.0.5

func MonthDays(year int) map[int]int

func ShortDay added in v0.0.3

func ShortDay() map[int]string

func ShortMonth added in v0.0.3

func ShortMonth() map[int]string

func SpanishDay added in v0.0.3

func SpanishDay() *map[int]string

func SpanishMonth added in v0.0.3

func SpanishMonth() map[int]string

func StringDateToShort added in v0.0.3

func StringDateToShort(date_in string, week model.TimeWeek) (textDay, day, textMonth, year string, err error)

formato fecha "2006-01-02" out; Vie,25,Dic,2011

Types

This section is empty.

Jump to

Keyboard shortcuts

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