From 1007f2c834bc13434bec6f2863aa46e94d1df890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Wed, 21 Feb 2024 18:33:18 +0100 Subject: [PATCH] v0.0.393 --- goextVersion.go | 4 ++-- rfctime/time.go | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/goextVersion.go b/goextVersion.go index 36cdd94..36cd72f 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.392" +const GoextVersion = "0.0.393" -const GoextVersionTimestamp = "2024-02-21T18:32:06+0100" +const GoextVersionTimestamp = "2024-02-21T18:33:18+0100" diff --git a/rfctime/time.go b/rfctime/time.go index 1b0e1b4..27fb583 100644 --- a/rfctime/time.go +++ b/rfctime/time.go @@ -125,6 +125,15 @@ func NewTime(h int, m int, s int, ns int) Time { } } +func NewTimeFromTS(t time.Time) Time { + return Time{ + Hour: t.Hour(), + Minute: t.Minute(), + Second: t.Second(), + NanoSecond: t.Nanosecond(), + } +} + func NowTime(loc *time.Location) Time { now := time.Now().In(loc) return NewTime(now.Hour(), now.Minute(), now.Second(), now.Nanosecond())