summaryrefslogtreecommitdiff
path: root/time.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-13 08:01:38 -0500
committerJeff Carr <[email protected]>2025-10-13 08:01:38 -0500
commitf386a0655a7147ba3e14da6bfd37b25ad5e0b151 (patch)
tree59b7942732b54b730354fbb97c173f2bd07b53e8 /time.go
parent114f34291f856f61f9aa3089952862bea4d50dd0 (diff)
never need zones if you are always on universal time
Diffstat (limited to 'time.go')
-rw-r--r--time.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/time.go b/time.go
index 2f5e6be..3b67554 100644
--- a/time.go
+++ b/time.go
@@ -7,6 +7,7 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"
)
+// you will be happier if you just use this everywhere
func Time(someTimeAgoOrLaterNotsure any) string {
t, err := TimeCheck(someTimeAgoOrLaterNotsure)
if errors.Is(err, Broken) {
@@ -18,6 +19,17 @@ func Time(someTimeAgoOrLaterNotsure any) string {
return FormatTime(t)
}
+func TimeLocal(someTimeAgoOrLaterNotsure any) string {
+ t, err := TimeCheck(someTimeAgoOrLaterNotsure)
+ if errors.Is(err, Broken) {
+ return "bad"
+ }
+ if errors.Is(err, NoTime) {
+ return "nope"
+ }
+ return FormatTimeLocal(t)
+}
+
func GetTime(mightBeTimeMightNotBeTime any) (time.Time, error) {
t, err := TimeCheck(mightBeTimeMightNotBeTime)
return t, err