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.
- Host: GitHub
- URL: https://github.com/jmrozanec/htime
- Owner: jmrozanec
- License: apache-2.0
- Created: 2015-06-01T23:26:18.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T02:59:53.000Z (over 7 years ago)
- Last Synced: 2025-03-25T17:07:04.294Z (about 1 year ago)
- Language: Java
- Homepage: http://cron-utils.com
- Size: 23.4 KB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.
[](https://flattr.com/submit/auto?user_id=jmrozanec&url=https://github.com/jmrozanec/htime)
[](https://travis-ci.org/jmrozanec/htime)
[](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!
[](https://flattr.com/submit/auto?user_id=jmrozanec&url=https://github.com/jmrozanec/htime)