12345678910111213141516171819202122232425262728293031323334353637383940 |
- package eliza
- import (
- "fmt"
- "hash/fnv"
- "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()
- }
- func hash(s string) uint32 {
- h := fnv.New32a()
- h.Write([]byte(s))
- return h.Sum32()
- }
|