Categorygithub.com/coccyx/timeparser
modulepackage
0.0.0-20161029180942-5644122b3667
Repository: https://github.com/coccyx/timeparser.git
Documentation: pkg.go.dev

# README

Timeparser

Build Status Go Report Card GoDoc

Go (golang) package for parsing time in Splunk's relative time syntax. See docs for format documentation, but here's some examples:

TimeDescription
-1mOne minute ago
+30m30 minutes from now
-4h@hFour hours ago, snapped to the hour
-1week@week+1dayOne week ago, snapped to Monday (1 day after Sunday, which is the default snap to)

For details, see the API documentation.

# Functions

TimeParser returns a parsed time based on the current time in the local time zone.
TimeParser returns a parsed time based on the current time in the passed time zone.
TimeParser returns a parsed time based on now returned from the passed callback in the local time zone.
TimeParser returns a parsed time based on now returned from the passed callback in the passed time zone.