Documentation ¶
Overview ¶
Package persian is part of the carbon package.
Index ¶
- type Gregorian
- type Month
- type Persian
- func (p Persian) Day() int
- func (p Persian) Hour() int
- func (p Persian) IsLeapYear() bool
- func (p Persian) IsZero() bool
- func (p Persian) Minute() int
- func (p Persian) Month() int
- func (p Persian) Second() int
- func (p Persian) String() string
- func (p Persian) ToGregorian() (g Gregorian)
- func (p Persian) ToMonthString() (month string)
- func (p Persian) ToWeekString() (month string)
- func (p Persian) Year() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gregorian ¶
Gregorian defines a Gregorian struct. 定义 Gregorian 结构体
func FromGregorian ¶
FromGregorian creates a Gregorian instance from time.Time. 从标准 time.Time 创建 Gregorian 实例
type Persian ¶
type Persian struct { Error error // contains filtered or unexported fields }
Persian defines a Persian struct. 定义 Persian 结构体
func FromPersian ¶
FromPersian creates a Persian instance from persian datetime. 从 波斯日期 创建 Persian 实例
func (Persian) IsLeapYear ¶
IsLeapYear reports whether is a leap year. 是否是闰年
func (Persian) String ¶
String implements Stringer interface and outputs a string in YYYY-MM-DD HH::ii::ss format like "1402-11-11 00:00:00". 实现 Stringer 接口, 输出 YYYY-MM-DD HH::ii::ss 格式字符串,如 "1402-11-11 00:00:00"
func (Persian) ToGregorian ¶
ToGregorian converts Persian instance to Gregorian instance. 将 Persian 实例转化为 Gregorian 实例
func (Persian) ToMonthString ¶
ToMonthString outputs a string in persian month format like "فروردین". 获取完整月份字符串,如 "فروردین"
func (Persian) ToWeekString ¶
ToWeekString outputs a string in week layout like "چهارشنبه". 输出完整星期字符串,如 "چهارشنبه"