An open API service indexing awesome lists of open source software.

https://github.com/jmrozanec/htime

Human readable datetime formatting for Java.
https://github.com/jmrozanec/htime

Last synced: 12 months ago
JSON representation

Human readable datetime formatting for Java.

Awesome Lists containing this project

README

          

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 appropriate formatter.

The project follows the [Semantic Versioning Convention](http://semver.org/) and uses Apache 2.0 license.

[![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=jmrozanec&url=https://github.com/jmrozanec/htime)
[![Build Status](https://travis-ci.org/jmrozanec/htime.png?branch=master)](https://travis-ci.org/jmrozanec/htime)

[![Project stats by OpenHub](https://www.openhub.net/p/htime/widgets/project_thin_badge.gif)](https://www.openhub.net/p/htime/)

**Download**

htime is available on [Maven central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.cronutils%22) repository.


com.cronutils
htime
1.0.0

**Features**

* Provide any date time format written in human readable text, and get the appropriate date time formatter!

**Usage Examples**

***Get JDK SimpleDateFormatter***

//define your own expressions to be formatted
HDateTimeFormat hDateTimeFormat =
HDateTimeFormatBuilder.getInstance().forJDK12().getFormatter();
SimpleDateFormat jdkTimeFormatter = hDateTimeFormat.forPattern("June 9, 2011");
String formattedDate = jdkTimeFormatter.format(new Date());
//formattedDate will be ex.: "June 9, 2015"

***Get JodaTime DateTimeFormatter***

//define your own expressions to be formatted
HDateTimeFormat hDateTimeFormat =
HDateTimeFormatBuilder.getInstance().forJodaTime().getFormatter();
DateTimeFormatter jodaTimeFormatter = hDateTimeFormat.forPattern("June 9, 2011");
String formattedDate = jodaTimeFormatter.print(DateTime.now());
//formattedDate will be ex.: "June 9, 2015"

**Contribute & Support!**

Contributions are welcome! You can contribute by
* star and/or Flattr this repo!
* requesting or adding new features. Check our [roadmap](https://github.com/jmrozanec/htime/wiki/Roadmap)!
* enhancing existing code: ex.: provide more accurate description cases
* testing
* enhancing documentation
* providing translations to support new locales
* bringing suggestions and reporting bugs
* spreading the word / telling us how you use it!

Check [our page](http://cronutils.com)! For stats about the project, you can visit our [OpenHUB profile](https://www.openhub.net/p/htime).

Support us donating once or by subscription through Flattr!

[![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=jmrozanec&url=https://github.com/jmrozanec/htime)