timetools

package module
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 3 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 string)

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) (err string)

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) (err string)

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

func DateToDayHour added in v0.0.31

func DateToDayHour(real_date, fake_date string, df *model.DateFormat) (date, hour string)

real_date:2006-01-02 15:04:05 fake_date 2006-01-02 or same real date return: date:"2006-01-02" hour:"15:04" optional seconds:"15:04:05" left

func DayOfYear added in v0.0.3

func DayOfYear(year, month, day int) (d int, err string)

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) (age int, err string)

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 JointDate added in v0.0.30

func JointDate(day, month, year string, spacer ...string) string

ej: day:01, month:30, year:2003 default result: "2003-30-01" with optional spacer ej: / = "2003/30/01" Important: input data is not validated

func MonthDays added in v0.0.5

func MonthDays(year int) map[int]int

func SeparateDateHourAndSeconds added in v0.0.31

func SeparateDateHourAndSeconds(date_in string) (date, hour, seconds string)

date_in: "2006-01-02 15:04:05" or "2006-01-02" out: date:"2006-01-02" hour:"15:04" seconds:"05"

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, err string)

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