HUGO
News Docs Themes Community GitHub

Add

TIME.Add DURATION

Returns the given time plus the given duration.

AddDate

TIME.AddDate YEARS MONTHS DAYS

Returns the time corresponding to adding the given number of years, months, and days to the given time.Time value.

After

TIME1.After TIME2

Reports whether TIME1 is after TIME2.

Before

TIME1.Before TIME2

Reports whether TIME1 is before TIME2.

Day

TIME.Day

Returns the day of the month of the given time.Time value.

Equal

TIME1.Equal TIME2

Reports whether TIME1 is equal to TIME2.

Format

TIME.Format LAYOUT

Returns a textual representation of the time.Time value formatted according to the layout string.

Hour

TIME.Hour

Returns the hour within the day of the given time.Time value, in the range [0, 23].

IsDST

TIME.IsDST

Reports whether the given time.Time value is in Daylight Savings Time.

IsZero

TIME.IsZero

Reports whether the given time.Time value represents the zero time instant, January 1, year 1, 00:00:00 UTC.

Local

TIME.Local

Returns the given time.Time value with the location set to local time.

Minute

TIME.Minute

Returns the minute offset within the hour of the given time.Time value, in the range [0, 59].

Month

TIME.Month

Returns the month of the year of the given time.Time value.

Nanosecond

TIME.Nanosecond

Returns the nanosecond offset within the second of the given time.Time value, in the range [0, 999999999].

Round

TIME.Round DURATION

Returns the result of rounding TIME to the nearest multiple of DURATION since January 1, 0001, 00:00:00 UTC.

Second

TIME.Second

Returns the second offset within the minute of the given time.Time value, in the range [0, 59].

Sub

TIME1.Sub TIME2

Returns the duration computed by subtracting TIME2 from TIME1.

Truncate

TIME.Truncate DURATION

Returns the result of rounding TIME down to a multiple of DURATION since January 1, 0001, 00:00:00 UTC.

Unix

TIME.Unix

Returns the given time.Time value expressed as the number of seconds elapsed since January 1, 1970 UTC.

UnixMicro

TIME.UnixMicro

Returns the given time.Time value expressed as the number of microseconds elapsed since January 1, 1970 UTC.

UnixMilli

TIME.UnixMilli

Returns the given time.Time value expressed as the number of milliseconds elapsed since January 1, 1970 UTC.

UnixNano

TIME.UnixNano

Returns the given time.Time value expressed as the number of nanoseconds elapsed since January 1, 1970 UTC.

UTC

TIME.UTC

Returns the given time.Time value with the location set to UTC.

Weekday

TIME.Weekday

Returns the day of the week of the given time.Time value.

Year

TIME.Year

Returns the year of the given time.Time value.

YearDay

TIME.YearDay

Returns the day of the year of the given time.Time value, in the range [1, 365] for non-leap years, and [1, 366] in leap years.