123456789101112131415161718192021222324252627282930313233 |
- package eliza
- import (
- "fmt"
- "time"
- )
- func year() string {
- year, _, _ := time.Now().Date()
- return fmt.Sprintf("%d", year)
- }
- func date() string {
- dw := time.Now().Weekday()
- mon := time.Now().Month()
- dom := time.Now().Day()
- s := "th"
- if dom == 1 || dom == 21 || dom == 31 {
- s = "st"
- }
- if dom == 2 || dom == 22 {
- s = "nd"
- }
- if dom == 3 {
- s = "rd"
- }
- return fmt.Sprintf("%s %d%s %s", dw, dom, s, mon)
- }
- func dayOfWeek() string {
- dt := time.Now().Weekday()
- return dt.String()
- }
|