mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-11 08:12:26 +08:00
doc: update doc styles
This commit is contained in:
@@ -68,8 +68,6 @@ import (
|
||||
|
||||
<div STYLE="page-break-after: always;"></div>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
|
||||
|
||||
## Documentation
|
||||
|
||||
## Note:
|
||||
@@ -109,7 +107,7 @@ import (
|
||||
func AddDay(t time.Time, day int64) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/dIGbs_uTdFa)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/dIGbs_uTdFa)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -148,7 +146,7 @@ func main() {
|
||||
func AddHour(t time.Time, hour int64) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/rcMjd7OCsi5)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/rcMjd7OCsi5)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -187,7 +185,7 @@ func main() {
|
||||
func AddMinute(t time.Time, minute int64) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/nT1heB1KUUK)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/nT1heB1KUUK)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -226,7 +224,7 @@ func main() {
|
||||
func AddYear(t time.Time, year int64) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/MqW2ujnBx10)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/MqW2ujnBx10)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -265,7 +263,7 @@ func main() {
|
||||
func BeginOfMinute(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/ieOLVJ9CiFT)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/ieOLVJ9CiFT)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -297,7 +295,7 @@ func main() {
|
||||
func BeginOfHour(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/GhdGFnDWpYs)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/GhdGFnDWpYs)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -329,7 +327,7 @@ func main() {
|
||||
func BeginOfDay(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/94m_UT6cWs9)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/94m_UT6cWs9)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -361,7 +359,7 @@ func main() {
|
||||
func BeginOfWeek(t time.Time, beginFrom ...time.Weekday) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/ynjoJPz7VNV)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/ynjoJPz7VNV)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -393,7 +391,7 @@ func main() {
|
||||
func BeginOfMonth(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/bWXVFsmmzwL)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/bWXVFsmmzwL)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -425,7 +423,7 @@ func main() {
|
||||
func BeginOfYear(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/i326DSwLnV8)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/i326DSwLnV8)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -457,7 +455,7 @@ func main() {
|
||||
func EndOfMinute(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/yrL5wGzPj4z)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/yrL5wGzPj4z)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -489,7 +487,7 @@ func main() {
|
||||
func EndOfHour(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/6ce3j_6cVqN)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/6ce3j_6cVqN)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -521,7 +519,7 @@ func main() {
|
||||
func EndOfDay(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/eMBOvmq5Ih1)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/eMBOvmq5Ih1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -553,7 +551,7 @@ func main() {
|
||||
func EndOfWeek(t time.Time, endWith ...time.Weekday) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/i08qKXD9flf)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/i08qKXD9flf)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -585,7 +583,7 @@ func main() {
|
||||
func EndOfMonth(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/_GWh10B3Nqi)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/_GWh10B3Nqi)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -617,7 +615,7 @@ func main() {
|
||||
func EndOfYear(t time.Time) time.Time
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/G01cKlMCvNm)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/G01cKlMCvNm)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -649,7 +647,7 @@ func main() {
|
||||
func GetNowDate() string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/PvfkPpcpBBf)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/PvfkPpcpBBf)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -678,7 +676,7 @@ func main() {
|
||||
func GetNowTime() string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/l7BNxCkTmJS)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/l7BNxCkTmJS)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -707,7 +705,7 @@ func main() {
|
||||
func GetNowDateTime() string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/pI4AqngD0al)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/pI4AqngD0al)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -736,7 +734,7 @@ func main() {
|
||||
func GetTodayStartTime() string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/84siyYF7t99)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/84siyYF7t99)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -765,7 +763,7 @@ func main() {
|
||||
func GetTodayEndTime() string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/jjrLnfoqgn3)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/jjrLnfoqgn3)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -794,7 +792,7 @@ func main() {
|
||||
func GetZeroHourTimestamp() int64
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/QmL2oIaGE3q)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/QmL2oIaGE3q)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -823,7 +821,7 @@ func main() {
|
||||
func GetNightTimestamp() int64
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/UolysR3MYP1)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/UolysR3MYP1)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -852,7 +850,7 @@ func main() {
|
||||
func FormatTimeToStr(t time.Time, format string, timezone ...string) string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/_Ia7M8H_OvE)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/_Ia7M8H_OvE)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -891,7 +889,7 @@ func main() {
|
||||
func FormatStrToTime(str, format string, timezone ...string) (time.Time, error)
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/1h9FwdU8ql4)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/1h9FwdU8ql4)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -930,7 +928,7 @@ type theTime struct {
|
||||
func NewUnixNow() *theTime
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/U4PPx-9D0oz)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/U4PPx-9D0oz)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -962,7 +960,7 @@ type theTime struct {
|
||||
func NewUnix(unix int64) *theTime
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/psoSuh_kLRt)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/psoSuh_kLRt)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -994,7 +992,7 @@ type theTime struct {
|
||||
func NewFormat(t string) (*theTime, error)
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/VkW08ZOaXPZ)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/VkW08ZOaXPZ)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1026,7 +1024,7 @@ type theTime struct {
|
||||
func NewISO8601(iso8601 string) (*theTime, error)
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/mkhOHQkdeA2)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/mkhOHQkdeA2)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1055,7 +1053,7 @@ func main() {
|
||||
func (t *theTime) ToUnix() int64
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/_LUiwAdocjy)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/_LUiwAdocjy)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1084,7 +1082,7 @@ func main() {
|
||||
func (t *theTime) ToFormat() string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/VkW08ZOaXPZ)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/VkW08ZOaXPZ)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1113,7 +1111,7 @@ func main() {
|
||||
func (t *theTime) ToFormatForTpl(tpl string) string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/nyXxXcQJ8L5)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/nyXxXcQJ8L5)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1143,7 +1141,7 @@ func main() {
|
||||
func (t *theTime) ToIso8601() string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/mkhOHQkdeA2)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/mkhOHQkdeA2)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1173,7 +1171,7 @@ func main() {
|
||||
func IsLeapYear(year int) bool
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/xS1eS2ejGew)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/xS1eS2ejGew)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1206,7 +1204,7 @@ func main() {
|
||||
func BetweenSeconds(t1 time.Time, t2 time.Time) int64
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/n3YDRyfyXJu)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/n3YDRyfyXJu)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1243,7 +1241,7 @@ func main() {
|
||||
func DayOfYear(t time.Time) int
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/0hjqhTwFNlH)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/0hjqhTwFNlH)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1284,7 +1282,7 @@ func main() {
|
||||
func IsWeekend(t time.Time) bool
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/cupRM5aZOIY)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/cupRM5aZOIY)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1324,7 +1322,7 @@ func main() {
|
||||
func NowDateOrTime(format string, timezone ...string) string
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/EZ-begEjtT0)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/EZ-begEjtT0)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1358,7 +1356,7 @@ func main() {
|
||||
func Timestamp(timezone ...string) int64
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/iU5b7Vvjx6x)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/iU5b7Vvjx6x)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1378,7 +1376,6 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### <span id="TimestampMilli">TimestampMilli</span>
|
||||
|
||||
<p>Return current mill second timestamp.</p>
|
||||
@@ -1389,7 +1386,7 @@ func main() {
|
||||
func TimestampMilli(timezone ...string) int64
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/4gvEusOTu1T)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/4gvEusOTu1T)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1419,7 +1416,7 @@ func main() {
|
||||
func TimestampMicro(timezone ...string) int64
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/2maANglKHQE)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/2maANglKHQE)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -1449,7 +1446,7 @@ func main() {
|
||||
func TimestampNano(timezone ...string) int64
|
||||
```
|
||||
|
||||
<b>Example:<span class="run-container">[Run](https://go.dev/play/p/A9Oq_COrcCF)</span></b>
|
||||
<b>Example:<span style="float:right;display:inline-block;">[Run](https://go.dev/play/p/A9Oq_COrcCF)</span></b>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
Reference in New Issue
Block a user