datetime

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDatetimeRange

func GetDatetimeRange(datetime_type string) (start_datetime string, end_datetime string, err error)

基于 当前时间 给定 日期时间周期格式 返回日期时间范围 的字符串

datetime_type: 1周前, 2周前, 1个月前, 2个月前, 3个月前, 6个月前, 1年前
例子: GetDatetimeRange("1周前") => "2021-08-02", "2021-08-09", nil

func GetNowString

func GetNowString() string

获取 当前时间 标准格式 2006-01-02 15:04:05

func GetNowStringSimple added in v0.0.7

func GetNowStringSimple() string

获取 当前时间 简单格式 20060102-150405

func GetNowStringWithDuration

func GetNowStringWithDuration(time_duration_string string) string

基于 当前时间 给定 时间间隔 duration,返回时间字符串

func ParseDatetime

func ParseDatetime(s string) types.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL