From 5993168de65b170445f026521f0050db83356d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Sat, 30 Apr 2022 23:21:38 +0800 Subject: [PATCH] add bson --- .gitignore | 1 + app.go | 2 ++ app_test.go | 2 ++ mongo.go | 6 ++++++ 4 files changed, 11 insertions(+) create mode 100644 mongo.go diff --git a/.gitignore b/.gitignore index 88685d9..2ee9f26 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .idea .vscode .log +gomod.sh \ No newline at end of file diff --git a/app.go b/app.go index 3bd7dfe..a666653 100644 --- a/app.go +++ b/app.go @@ -5,6 +5,8 @@ import ( "time" ) +const Version = "1.0.1" + // 时间格式化常量 const ( RFC3339Format = time.RFC3339 diff --git a/app_test.go b/app_test.go index c49b795..8d6b278 100644 --- a/app_test.go +++ b/app_test.go @@ -53,6 +53,8 @@ func TestTime(t *testing.T) { t.Log("相差多少小时(绝对值):", SetCurrentParse("2022-03-01T10:03:39+08:00").Format()) t.Log("相差多少小时(绝对值):", SetCurrentParse("2022-03-04T11:12:47+08:00").Format()) + + t.Log("BSON:", Current().Bson()) } func TestDayStartOfEnd(t *testing.T) { diff --git a/mongo.go b/mongo.go new file mode 100644 index 0000000..314fe54 --- /dev/null +++ b/mongo.go @@ -0,0 +1,6 @@ +package gotime + +// Bson mongoDB +func (p Pro) Bson() string { + return p.Now().String() +}