datetime

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Epoch

func Epoch() time.Time

Epoch return fit epoch (31 Dec 1989 00:00:000 UTC) as time.Time

func ToLocalTime

func ToLocalTime(value any, tzOffsetHours int) time.Time

ToLocalTime returns time in local time zone by specifying the time zone offset hours (+7 for GMT+7).

func ToTime

func ToTime(value any) time.Time

ToTime return new time based on given v.

func ToUint32

func ToUint32(t time.Time) uint32

Convert t into uint32 fit representative time value.

func TzOffsetHours

func TzOffsetHours(localDateTime, dateTime time.Time) int

TzOffsetHours calculates time zone offset.

formula ilustration: (activity.LocalTimestamp - activity.Timestamp) / 3600

func TzOffsetHoursFromUint32 added in v0.4.0

func TzOffsetHoursFromUint32(localDateTime, dateTime uint32) int

TzOffsetHoursFromUint32 is similiar to TzOffsetHours but it took uint32 as parameters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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