modulepackage
0.0.0-20161029180942-5644122b3667
Repository: https://github.com/coccyx/timeparser.git
Documentation: pkg.go.dev
# README
Timeparser
Go (golang) package for parsing time in Splunk's relative time syntax. See docs for format documentation, but here's some examples:
Time | Description |
---|---|
-1m | One minute ago |
+30m | 30 minutes from now |
-4h@h | Four hours ago, snapped to the hour |
-1week@week+1day | One 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.