Documentation ¶
Index ¶
- Constants
- func DateEqual(date1, date2 time.Time) bool
- func FirstDayOfMonth(t time.Time) time.Time
- func FromString(date string) (r time.Time)
- func GetDateFromTime(v time.Time, timezone TimeZones) time.Time
- func GetDaysBetweenDates(startDate, endDate time.Time) int
- func GetEndOfTheDay(v time.Time) time.Time
- func GetMonthName(date time.Time, lang language.Tag) string
- func GetNextDayOfWeek(t time.Time) time.Time
- func GetStartOfTheDay(v time.Time) time.Time
- func GetTempo(duration time.Duration) (r string)
- func IntToTime(v int64) time.Time
- func IsWeekend(t time.Time) bool
- func LastDayOfMonth(t time.Time) time.Time
- func NextDateByDay(day, maxDay int) time.Time
- func NextDay(t time.Time) time.Time
- func TimeStampToDateString(timestamp *timestamp.Timestamp) string
- func TimeStampToDateTimeString(timestamp *timestamp.Timestamp) string
- func TimeStampToTime(timestamp *timestamp.Timestamp) time.Time
- func TimeToString(timestamp time.Time) string
- func TimeToStringPtBR(timestamp time.Time) string
- func TimeToTimeStamp(time time.Time) *timestamp.Timestamp
- func ToTime(v interface{}) time.Time
- type TimeZones
Constants ¶
const ( TimeZoneSaoPaulo = "America/Sao_Paulo" DateTimeFormatDatabase = "2006-01-02T15:04:05" DateFormatDatabase = "2006-01-02" DateTimeBr = "02/01/2006 15:04:05" DateBr = "02/01/2006" Days = time.Hour * 24 )
Variables ¶
This section is empty.
Functions ¶
func DateEqual ¶
DateEqual compare two dates if they are equals, ignoring the time and considering only the date return true if they are equals
func FirstDayOfMonth ¶
FirstDayOfMonth return the time and set day 1
func FromString ¶
FromString function to return a time.Time given a string, it automatically tries to convert from several and common formats, if it has error, return time zeroValue
func GetDaysBetweenDates ¶
GetDaysBetweenDates return the diference of the of days between two dates object
func GetEndOfTheDay ¶
GetEndOfTheDay essa funcao altera um horario para o final do dia, 23:59:59
func GetMonthName ¶
GetMonthName retorna o nome do mês baseado na lingua passada como parametro, padrao é ingles
func GetNextDayOfWeek ¶
IsWeekend retorna o próximo dia da semana
func GetStartOfTheDay ¶
GetStartOfTheDay essa funcao altera um horario para o inicio do dia, 00:00:00
func GetTempo ¶
GetTempo retorna uma string informado o tempo em portugues que falta a partir de um objeto Duration
func LastDayOfMonth ¶
LastDayOfMonth return the time with last day of the month
func NextDateByDay ¶
NextDateByDay retorna a proxima data baseado no dia