Documentation ¶
Overview ¶
Package asetime is used to convert golang data type duration to defined ASE data type duration and the other way around.
The types, functions, and variables/constants defined in this package are mainly used in asetype/goValue.go as well as in asetype/bytes.go.
Index ¶
Constants ¶
const ( Microsecond ASEDuration = 1 Millisecond = 1000 * Microsecond Second = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute Day = 24 * Hour )
Base time-units in reference to ASEDuration.
Variables ¶
This section is empty.
Functions ¶
func Epoch1753 ¶
Epoch1753 returns the reference date of 01.01.1753 as the minimum date value for a datetime on a SQL Server.
func Epoch1900 ¶
Epoch1900 returns the reference date of 01.01.1900 that is required for asetype 'DATE', 'SHORTDATE', and 'DATETIME'.
func EpochRataDie ¶
EpochRataDie returns the reference date of Rata Die that is required for asetype 'BIGTIMEN'.
func MicrosecondsToTime ¶
MicrosecondsToTime takes the number of microseconds since time.Time{} and calculates the appropriate time.Time.
func MillisecondToFractionalSecond ¶
MillisecondToFractionalSecond returns milliseconds as fractional second.
func TimeToMicroseconds ¶
TimeToMicroseconds converts a time.Time into the number of microseconds elapsed since time.Time{}.
Types ¶
type ASEDuration ¶
type ASEDuration int
ASEDuration is the reference time-unit as microseconds.
func DurationAsASEDuration ¶
func DurationAsASEDuration(d time.Duration) ASEDuration
DurationAsASEDuration returns type time.Duration as type ASEDuration.
func DurationFromDateTime ¶
func DurationFromDateTime(t time.Time) ASEDuration
DurationFromDateTime returns duration based on passed time.Time.
func DurationFromTime ¶
func DurationFromTime(t time.Time) ASEDuration
DurationFromTime returns duration based on passed time.Time.
func FractionalSecondToMillisecond ¶
func FractionalSecondToMillisecond(s int) ASEDuration
FractionalSecondToMillisecond returns a fractional second as millisecond.
func (ASEDuration) Microseconds ¶
func (d ASEDuration) Microseconds() int
Microseconds returns duration in microseconds.
func (ASEDuration) Milliseconds ¶
func (d ASEDuration) Milliseconds() int
Milliseconds returns duration in milliseconds.
func (ASEDuration) Minutes ¶
func (d ASEDuration) Minutes() int
Minutes returns duration in minutes.
func (ASEDuration) Seconds ¶
func (d ASEDuration) Seconds() int
Seconds returns duration in seconds.