cron-utils

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

License

License

GroupId

GroupId

com.cronutils
ArtifactId

ArtifactId

cron-utils-timestrings
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

cron-utils
A Java library to update expressions with a given point in time, in a custom format.
Project URL

Project URL

http://cron-utils.com/
Source Code Management

Source Code Management

https://github.com/jmrozanec/cron-utils-timestrings

Download cron-utils-timestrings

How to add to project

<!-- https://jarcasting.com/artifacts/com.cronutils/cron-utils-timestrings/ -->
<dependency>
    <groupId>com.cronutils</groupId>
    <artifactId>cron-utils-timestrings</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.cronutils/cron-utils-timestrings/
implementation 'com.cronutils:cron-utils-timestrings:0.1.0'
// https://jarcasting.com/artifacts/com.cronutils/cron-utils-timestrings/
implementation ("com.cronutils:cron-utils-timestrings:0.1.0")
'com.cronutils:cron-utils-timestrings:jar:0.1.0'
<dependency org="com.cronutils" name="cron-utils-timestrings" rev="0.1.0">
  <artifact name="cron-utils-timestrings" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.cronutils', module='cron-utils-timestrings', version='0.1.0')
)
libraryDependencies += "com.cronutils" % "cron-utils-timestrings" % "0.1.0"
[com.cronutils/cron-utils-timestrings "0.1.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.12
org.apache.commons : commons-lang3 jar 3.4
joda-time : joda-time jar 2.8.2

test (6)

Group / Artifact Type Version
org.slf4j : slf4j-log4j12 jar 1.7.12
log4j : log4j jar 1.2.17
junit : junit jar 4.12
org.mockito : mockito-core jar 1.10.19
org.powermock : powermock-module-junit4 jar 1.6.2
org.powermock : powermock-api-mockito jar 1.6.2

Project Modules

There are no modules declared in this project.

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.

Versions

Version
0.1.0