Skip to content

jmrozanec/cron-utils-timestrings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cron-utils-timestrings

A Java library to provide human readable time strings and means to replace them with an actual date. The project follows the Semantic Versioning Convention and uses Apache 2.0 license.

Gitter Chat Build Status Coverage Status

Download

cron-utils-timestrings is available on Maven central repository.

<dependency>
    <groupId>com.cronutils</groupId>
    <artifactId>cron-utils-timestrings</artifactId>
    <version>0.1.0</version>
</dependency>

Features

  • Define a human readable point in time and get accurate date replacement when required.

Usage Examples

String sql = given("SELECT * FROM tracks WHERE ds>='YESTERDAY' AND ds<'TODAY'")
                .registerReplacement("YESTERDAY", "yyyy-MM-dd", date->date.minusDays(1))
                .registerReplacement("TODAY", "yyyy-MM-dd", date->date)
                .buildExpression(DateTime.now());
//should give us: SELECT * FROM tracks WHERE ds>='2016-06-16' AND ds<'2016-06-17'

Contribute & Support!

Contributions are welcome! You can contribute by

  • starring and/or Flattring this repo!
  • requesting or adding new features.
  • enhancing existing code
  • testing
  • enhancing documentation
  • bringing suggestions and reporting bugs
  • spreading the word / telling us how you use it!

Check our page! For stats about the project, you can visit our OpenHUB profile.

Support us donating once or by subscription through Flattr!

Flattr this!

Other cron-utils projects

You are welcome to visit and use the following cron-utils projects:

  • cron-utils: A Java library to parse, validate, migrate crons as well as get human readable descriptions for them.
  • cron-utils-spring: A Java library to describe cron expressions in human readable language at Spring framework, using cron-utils.
  • sisyphus: A cron-utils based scala scheduler. Supports any cron format and executes tasks all over again.
  • htime: A Java library to make it easy for humans format a date. You no longer need to remember date time formatting chars: just write an example, and you will get the appropiate formatter.

About

A Java library to update expressions with a given point in time, in a custom format.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages