time

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromFrameAndFPS

func FromFrameAndFPS(frame int, fps float64) time.Time

FromFrameAndFPS calculates the time that a frame would display at given

a certain FPS. if FPS is zero, the zero time is returned.

func FromSRTTimecode

func FromSRTTimecode(timecode string) (time.Time, error)

FromSRTTimecode translates the typical timecode found in an SRT file

e.g. (1:23:45:678) into the corresponding Time

func Max

func Max(a, b time.Time) time.Time

Max returns the time that is latest.

func Min

func Min(a, b time.Time) time.Time

Min returns the time that is earliest.

func Scale

func Scale(t time.Time, origin time.Time, factor float64) time.Time

Scale scales t from origin by factor.

e.g. t: 0:00:01.000, origin: 0:00:02.000, factor: 2.0 -> 0:00:03.000

func ToASSTimecode

func ToASSTimecode(t time.Time) string

ToASSTimecode formats a time as a timecode which is appropriate

for use in an ASS file.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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