func ExampleGetZeroHourTimestamp() { ts := GetZeroHourTimestamp() fmt.Println(ts) // Output: // 1673107200 } func ExampleGetNightTimestamp() { ts := GetNightTimestamp() fmt.Println(ts) // Output: // 1673193599 }
()
| 196 | // } |
| 197 | |
| 198 | func ExampleFormatTimeToStr() { |
| 199 | datetime, _ := time.Parse("2006-01-02 15:04:05", "2021-01-02 16:04:08") |
| 200 | |
| 201 | result1 := FormatTimeToStr(datetime, "yyyy-mm-dd hh:mm:ss") |
| 202 | result2 := FormatTimeToStr(datetime, "yyyy-mm-dd") |
| 203 | result3 := FormatTimeToStr(datetime, "dd-mm-yy hh:mm:ss") |
| 204 | result4 := FormatTimeToStr(datetime, "yyyy-mm-dd hh") |
| 205 | |
| 206 | fmt.Println(result1) |
| 207 | fmt.Println(result2) |
| 208 | fmt.Println(result3) |
| 209 | fmt.Println(result4) |
| 210 | |
| 211 | // Output: |
| 212 | // 2021-01-02 16:04:08 |
| 213 | // 2021-01-02 |
| 214 | // 02-01-21 16:04:08 |
| 215 | // 2021-01-02 16 |
| 216 | } |
| 217 | |
| 218 | func ExampleFormatStrToTime() { |
| 219 | result1, _ := FormatStrToTime("2021-01-02 16:04:08", "yyyy-mm-dd hh:mm:ss") |
nothing calls this directly
no test coverage detected
searching dependent graphs…