Documentation
¶
Overview ¶
Package calendar is part of the carbon package.
Index ¶
- Constants
- type Gregorian
- func (g Gregorian) Clock() (hour, minute, second int)
- func (g Gregorian) Date() (year, month, day int)
- func (g Gregorian) Day() int
- func (g Gregorian) Hour() int
- func (g Gregorian) IsLeapYear() bool
- func (g Gregorian) IsZero() bool
- func (g Gregorian) Location() *time.Location
- func (g Gregorian) Minute() int
- func (g Gregorian) Month() int
- func (g Gregorian) Second() int
- func (g Gregorian) String() string
- func (g Gregorian) Week() int
- func (g Gregorian) Year() int
Constants ¶
View Source
const ( January = "January" // 一月 February = "February" // 二月 March = "March" // 三月 April = "April" // 四月 May = "May" // 五月 June = "June" // 六月 July = "July" // 七月 August = "August" // 八月 September = "September" // 九月 October = "October" // 十月 November = "November" // 十一月 December = "December" // 十二月 )
month constants 月份常量
View Source
const ( Monday = "Monday" // 周一 Tuesday = "Tuesday" // 周二 Wednesday = "Wednesday" // 周三 Thursday = "Thursday" // 周四 Friday = "Friday" // 周五 Saturday = "Saturday" // 周六 Sunday = "Sunday" // 周日 )
week constants 星期常量
View Source
const ( YearsPerMillennium = 1000 // 每千年1000年 YearsPerCentury = 100 // 每世纪100年 YearsPerDecade = 10 // 每十年10年 QuartersPerYear = 4 // 每年4个季度 MonthsPerYear = 12 // 每年12月 MonthsPerQuarter = 3 // 每季度3月 WeeksPerNormalYear = 52 // 每常规年52周 WeeksPerMonth = 4 // 每月4周 DaysPerLeapYear = 366 // 每闰年366天 DaysPerNormalYear = 365 // 每常规年365天 DaysPerWeek = 7 // 每周7天 HoursPerWeek = 168 // 每周168小时 HoursPerDay = 24 // 每天24小时 MinutesPerDay = 1440 // 每天1440分钟 MinutesPerHour = 60 // 每小时60分钟 SecondsPerWeek = 604800 // 每周604800秒 SecondsPerDay = 86400 // 每天86400秒 SecondsPerHour = 3600 // 每小时3600秒 SecondsPerMinute = 60 // 每分钟60秒 )
number constants 数字常量
View Source
const ( AtomLayout = RFC3339Layout ANSICLayout = time.ANSIC CookieLayout = "Monday, 02-Jan-2006 15:04:05 MST" KitchenLayout = time.Kitchen RssLayout = time.RFC1123Z RubyDateLayout = time.RubyDate UnixDateLayout = time.UnixDate W3cLayout = RFC3339Layout RFC1036Layout = "Mon, 02 Jan 06 15:04:05 -0700" RFC1123Layout = time.RFC1123 RFC1123ZLayout = time.RFC1123Z RFC2822Layout = time.RFC1123Z RFC3339Layout = "2006-01-02T15:04:05Z07:00" RFC3339MilliLayout = "2006-01-02T15:04:05.999Z07:00" RFC3339MicroLayout = "2006-01-02T15:04:05.999999Z07:00" RFC3339NanoLayout = "2006-01-02T15:04:05.999999999Z07:00" RFC7231Layout = "Mon, 02 Jan 2006 15:04:05 MST" RFC822Layout = time.RFC822 RFC822ZLayout = time.RFC822Z RFC850Layout = time.RFC850 ISO8601Layout = "2006-01-02T15:04:05-07:00" ISO8601MilliLayout = "2006-01-02T15:04:05.999-07:00" ISO8601MicroLayout = "2006-01-02T15:04:05.999999-07:00" ISO8601NanoLayout = "2006-01-02T15:04:05.999999999-07:00" DayDateTimeLayout = "Mon, Jan 2, 2006 3:04 PM" DateTimeLayout = "2006-01-02 15:04:05" DateTimeMilliLayout = "2006-01-02 15:04:05.999" DateTimeMicroLayout = "2006-01-02 15:04:05.999999" DateTimeNanoLayout = "2006-01-02 15:04:05.999999999" ShortDateTimeLayout = "20060102150405" ShortDateTimeMilliLayout = "20060102150405.999" ShortDateTimeMicroLayout = "20060102150405.999999" ShortDateTimeNanoLayout = "20060102150405.999999999" DateLayout = "2006-01-02" DateMilliLayout = "2006-01-02.999" DateMicroLayout = "2006-01-02.999999" DateNanoLayout = "2006-01-02.999999999" ShortDateLayout = "20060102" ShortDateMilliLayout = "20060102.999" ShortDateMicroLayout = "20060102.999999" ShortDateNanoLayout = "20060102.999999999" TimeLayout = "15:04:05" TimeMilliLayout = "15:04:05.999" TimeMicroLayout = "15:04:05.999999" TimeNanoLayout = "15:04:05.999999999" ShortTimeLayout = "150405" ShortTimeMilliLayout = "150405.999" ShortTimeMicroLayout = "150405.999999" ShortTimeNanoLayout = "150405.999999999" )
layout constants 布局模板常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gregorian ¶
Gregorian defines a Gregorian struct. 定义 Gregorian 结构体
func NewGregorian ¶
NewGregorian returns a new Gregorian instance. 初始化 Gregorian 结构体
func (Gregorian) IsLeapYear ¶
IsLeapYear reports whether is a leap year. 是否是闰年
Directories
¶
Path | Synopsis |
---|---|
Package julian is part of the carbon package.
|
Package julian is part of the carbon package. |
Package lunar is part of the carbon package.
|
Package lunar is part of the carbon package. |
Package persian is part of the carbon package.
|
Package persian is part of the carbon package. |
Click to show internal directories.
Click to hide internal directories.