Documentation
¶
Index ¶
Constants ¶
View Source
const ( MILLISECONDS Timeframe = "milli" SECONDS = "s" MINUTES = "min" HOURS = "hr" DAYS = "d" //days is not totally correct as it does not handle DST atm. )
Variables ¶
View Source
var TrendrrEpoch, _ = time.Parse("Mon Jan 2 15:04:05 MST 2006", "Fri Dec 31 21:00:00 PST 1999")
View Source
var USEast, _ = time.LoadLocation("America/New_York")
Functions ¶
func IsEasternDayLight ¶
checks if the given time is in NYC daylight savings time.
Types ¶
type Time ¶
type Time struct { time.Time TimeAmount TimeAmount TrendrrEpoch int64 }
wraps a regular Time struct to contain the TimeAmount and associated Epoch.
type TimeAmount ¶
type TimeAmount struct {
// contains filtered or unexported fields
}
func Parse ¶
func Parse(timeamount string) (TimeAmount, error)
parses a timeamount usually in the form 15 minutes
func (*TimeAmount) FromTrendrrEpoch ¶
func (this *TimeAmount) FromTrendrrEpoch(epoch int64) Time
func (*TimeAmount) String ¶
func (this *TimeAmount) String() string
func (*TimeAmount) ToDuration ¶
func (this *TimeAmount) ToDuration() (time.Duration, error)
Translates to a regular duration
func (*TimeAmount) ToTime ¶
func (this *TimeAmount) ToTime(time time.Time) Time
Translates a go time to a timeamount.Time
func (*TimeAmount) ToTrendrrEpoch ¶
func (this *TimeAmount) ToTrendrrEpoch(time time.Time) int64
Click to show internal directories.
Click to hide internal directories.