This package can parse date match expression, which used by ElasticSearch

datemath-parser

this package is pure go package, this package can parse date match expression, which used by ElasticSearch.

Date Math Definition

you can click here to see date math definition. The date type supports using date math expression when using it in a range date query. The expression starts with an "anchor" date, which can be either now or a date string (in the applicable format) ending with ||. It can then follow by a math expression, supporting +, - and / (time rounding symbol). The support time units are:

time unit symbol meaning
y Years
M Months
w Weeks
d Days
h Hours
H Hours
m Minutes
s Seconds

Here are some samples: now+1h, now+1h+1m, now+1h/d, 2012-01-01||+1M/d.

Note, when doing range type searches, and the upper value is inclusive, the rounding will properly be rounded to the ceiling instead of flooring it.

Usage

Returns an int64 representing timestamp in milliseconds

package main

import (
    "fmt"
    "github.com/zhuliquan/datemath-parser"
)

func main() {
    

    
}
Owner
zhuliquan
Graduate student in Wuhan University of Technology
zhuliquan
Similar Resources

A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

Fake-SMS A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a pr

Dec 31, 2022

CLI for SendGrid, which helps in managing SSO users, can install and update users from yaml config

Sendgrid API This script is needed to add new users to SendGrid as SSO teammates. Previously, all users were manually added and manually migrating the

Jul 20, 2022

A simple tool which you can use to move through your directories from the command line

Fe What is Fe ? Fe is a simple tool which you can use to move through your direc

Jan 1, 2022

Program to convert plain text to CSV file which can imported into Anki.

Program to convert plain text to CSV file which can imported into Anki. The motivation of this program is to save time by automatically coverting Question and Answer into CSV file which can be imported directly into Anki.

May 22, 2022

CLI tool (hcron) and Go library (cron) to convert CRON expression into human readable description.

cron cron is a Go library that parses a cron expression and outputs a human readable description of the cron schedule. For example, given the expressi

Nov 12, 2022

A CLI command to parse Terraform execution result and notify it to Backlog

A CLI command to parse Terraform execution result and notify it to Backlog

tf2b Fork of mercari/tfnotify tf2b parses Terraform commands' execution result and applies it to an arbitrary template and then notifies it to Backlog

Oct 15, 2021

Parse .har files to create Go http requests

HAR-Parser Parse .har files to create Go http requests Usage $ ./HAR-Parser myfi

Jul 14, 2022

Needlessly complex program to parse, increment, and push the latest version number tag on github. Made with 😫 , 😓 & 😭

increment What is this? Needlessly complex program to parse, increment, and push the latest version number tag on github. Err handling by Sentry Made

Feb 28, 2022
espnwrapper to track real time scores for your fav match... in a terminal while working.
espnwrapper to track real time scores for your fav match... in a terminal while working.

An espncricinfo wrapper written in go to track scores in real time and in the cmd/cli you can find the Command Line Interface wrapped over this wrapper.

Mar 13, 2022
Json-match - Command line util for matching values in a JSON input

json-match Match JSON input by specifying key and value > json-match -json '{\"p

Jan 12, 2022
Package osargs provides functions to parse command line arguments

osargs About Package osargs provides functions to parse command line arguments. It is published on https://github.com/vbsw/osargs and https://gitlab.c

May 8, 2022
Command-line tool to organize large directories of media files recursively by date, detecting duplicates.

go-media-organizer Command-line tool written in Go to organise all media files in a directory recursively by date, detecting duplicates.

Jan 6, 2022
CLI tool for endoflife.date

eol eol is command line tool for endoflife.date. This is mostly inspired from norwegianblue built in python. getting Started go install github.com/kob

Nov 5, 2022
The blackbean is a command tool for elasticsearch operations by using cobra.
The blackbean is a command tool for elasticsearch operations by using cobra.

The blackbean is a command tool for elasticsearch operations by using cobra. Besides, blackbean is the name of my lovely French bulldog.

Mar 3, 2022
A simple CLI tool to use the _simulate API of elasticsearch to quickly test pipelines

elasticsearch-pipeline-tester A simple CLI tool to use the _simulate API of elasticsearch to quickly test pipelines usage: pipelinetester [<flags>] <p

Oct 19, 2021
Esdump is a migration CLI written in Go for migrating index mapping and data from one elasticsearch to another.

esdump Introduction esdump is a migration CLI written in Go for migrating index mapping and data from one elasticsearch to another. Compatibility Elas

Jul 23, 2022
linenoise-classic is a command-line tool that generates strings of random characters that can be used as reasonably secure passwords.

linenoise-classic is a command-line tool that generates strings of random characters that can be used as reasonably secure passwords.

Aug 21, 2022
Bofin - A command line tool that can be used by to make Weblink development more productive

Bofin A command line tool that can be used by to make Weblink development more p

Jan 13, 2022