{"id":15529114,"url":"https://github.com/marcinorlowski/datetimetemplate","last_synced_at":"2025-10-27T18:32:41.355Z","repository":{"id":101431429,"uuid":"84345667","full_name":"MarcinOrlowski/DateTimeTemplate","owner":"MarcinOrlowski","description":"Android date/time formatting library supporting formatting placeholders","archived":false,"fork":false,"pushed_at":"2023-12-30T20:25:29.000Z","size":249,"stargazers_count":45,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T12:53:05.082Z","etag":null,"topics":["android","android-library","date-formatting","datetime"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcinOrlowski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-08T17:04:00.000Z","updated_at":"2023-10-09T14:22:23.000Z","dependencies_parsed_at":"2025-03-05T15:41:34.861Z","dependency_job_id":null,"html_url":"https://github.com/MarcinOrlowski/DateTimeTemplate","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/MarcinOrlowski/DateTimeTemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcinOrlowski%2FDateTimeTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcinOrlowski%2FDateTimeTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcinOrlowski%2FDateTimeTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcinOrlowski%2FDateTimeTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcinOrlowski","download_url":"https://codeload.github.com/MarcinOrlowski/DateTimeTemplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcinOrlowski%2FDateTimeTemplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266828735,"owners_count":23991220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","date-formatting","datetime"],"created_at":"2024-10-02T11:16:25.046Z","updated_at":"2025-10-27T18:32:41.304Z","avatar_url":"https://github.com/MarcinOrlowski.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Release](https://jitpack.io/v/MarcinOrlowski/datetimetemplate.svg)](https://jitpack.io/#MarcinOrlowski/DateTimeTemplate)\r\n![Downloads](https://jitpack.io/v/MarcinOrlowski/DateTimeTemplate/month.svg)\r\n[![Dependency Status](https://dependencyci.com/github/MarcinOrlowski/DateTimeTemplate/badge)](https://dependencyci.com/github/MarcinOrlowski/DateTimeTemplate)\r\n\r\nDateTimeTemplate\r\n================\r\n`DateTimeTemplate` is flexible date/time formatting library with placeholders support.\r\n\r\n![Demo app](img/demo.png)\r\n\r\nDownload demo application APK from [releases](https://github.com/MarcinOrlowski/DateTimeTemplate/releases)\r\nsection. Source code in project's `app/` module.\r\n\r\n## Features ##\r\n\r\n* Easy to use,\r\n* Stable and production ready,\r\n* Localization support,\r\n* Lightweight,\r\n* No extra dependencies,\r\n* Free.\r\n\r\nInstallation\r\n============\r\n\r\nEdit your master `gradle.build` file and **add** `maven { url 'https://jitpack.io' }` to your current\r\n`repositories` block content (if you use other jitpack hosted libraries, then this step can be skipped):\r\n\r\n    allprojects {\r\n      repositories {\r\n        maven { url 'https://jitpack.io' }\r\n        }\r\n    }\r\n\r\nNext, edit your **module**'s `build.gradle` and the following dependency:\r\n\r\n    compile 'com.github.MarcinOrlowski:datetimetemplate:\u003cVERSION\u003e'\r\n\r\nFor recent value of `\u003cVERSION\u003e` consult [library releases](https://github.com/MarcinOrlowski/DateTimeTemplate/releases)\r\nor jitpack\r\nbadge: [![Release](https://jitpack.io/v/MarcinOrlowski/datetimetemplate.svg)](https://jitpack.io/#MarcinOrlowski/datetimetemplate)\r\n\r\n\r\nPlaceholders\r\n============\r\n\r\nYour formatting string can contain anything you like, however certain sequences are considered placeholders, and will be replaced\r\nby corresponding values. Non-placeholders are returned unprocessed\r\n\r\n| Placeholder | Description |\r\n|-------------|-------------|\r\n| %yy%        | long year (i.e. \"2009\") |\r\n| %y%        | short year (i.e. \"09\") |\r\n| %MMM%        | long month name (i.e. \"January\") |\r\n| %MM%        | abbreviated month name (i.e. \"Jan\") |\r\n| %M%        | first letter of month name (i.e. \"J\") |\r\n| %mm%        | zero prefixed 2 digit month number (\"02\" for Feb, \"12\" for Dec) |\r\n| %m%        | month number as is (\"2\" for Feb, \"12\" for Dec) |\r\n| %DDD%        | full day name (i.e. \"\"Saturday\", \"Sunday\", \"Monday\") |\r\n| %DD%        | abbreviated day name (\"Sat\", \"Sun\", \"Mon\") |\r\n| %D%        | one letter day name (\"S\", \"S\", \"M\") |\r\n| %dd%        | zero prefixed 2 digit day number (\"01\", \"27\") |\r\n| %d%        | day number as is (\"1\", \"27\") |\r\n| %dy%        | day number of the year (i.e. \"250\") |\r\n| %dw%        | day number in week (i.e. \"1\" for Monday **if** weeks start on Mondays!) |\r\n| %wm%        | week number of current month (\"3\" for 3rd week) |\r\n| %wy%        | week number of the year (\"3\" for 3rd week, 47 for 47th) |\r\n| %hh%        | current hour, zero prefixed, 24hrs clock (i.e. \"01\", \"16\") |\r\n| %h%        | current hour, 24hrs clock (i.e. \"1\", \"16\") |\r\n| %kk%        | current hour, zero prefixed, 12hrs clock (i.e. \"01\", \"11\") |\r\n| %k%        | current hour, 12hrs clock (i.e. \"1\", \"11\") |\r\n| %ii%        | current minute, zero prefixed (i.e. \"01\", \"35\") |\r\n| %i%        | current minute, zero prefixed (i.e. \"1\", \"35\") |\r\n| %AA%        | upper-cased AM/PM marker (i.e. \"AM\") |\r\n| %A%        | upper-cased abbreviated AM/PM marker. \"A\" for \"AM\", \"P\" for \"PM\" |\r\n| %aa%        | lower-cased am/pm marker (i.e. \"am\") |\r\n| %a%        | lower-cased abbreviated AM/PM marker. \"a\" for \"am\", \"p\" for \"pm\" |\r\n| %Aa%        | AM/PM marker with first letter uppercased (i.e. \"Am\"/\"Pm\") |\r\n\r\nExamples\r\n========\r\n\r\nFormat current date, time as it is in `GMT` zone, using 24hrs clock format:\r\n\r\n    TimeZone tz = TimeZone.getTimeZone(\"GMT\");\r\n    Calendar c = new GregorianCalendar(tz);\r\n    c.setTime(new Date());\r\n\r\n    String formatted = DateTimeTemplate.format(c, \"GMT: %DD% %hh%:%ii%\");\r\n\r\nwould produce  `GMT: Mon 16:25`.\r\n\r\nFormat current time as it is in `Pacific Daylight Time` zone (`PDT` is 7 hours behind `GMT`), using 12hrs clock format with\r\nabbreviated AM/PM marker:\r\n\r\n    TimeZone tz = TimeZone.getTimeZone(\"GMT-0700\");\r\n    Calendar c = new GregorianCalendar(tz);\r\n    c.setTime(new Date());\r\n\r\n    String formatted = DateTimeTemplate.format(c, \"Time: %k%:%ii%%a%\");\r\n\r\nwould produce `Time: 3:25a`.\r\n\r\nFormat current time using device's time zone:\r\n\r\n    TimeZone tz = TimeZone.getDefault();\r\n    Calendar c = new GregorianCalendar(tz);\r\n    c.setTime(new Date());\r\n\r\n    String formatted = DateTimeTemplate.format(c, ...);\r\n\r\nFormatting using locale of your choice:\r\n\r\n    String formatted = DateTimeTemplate.format(cal, \"Time: %k%:%ii%%a%\", Locale.SIMPLIFIED_CHINESE);\r\n\r\nContributing\r\n============\r\n\r\nPlease report any issue spotted using [GitHub's project tracker](https://github.com/MarcinOrlowski/DateTimeTemplate/issues).\r\n\r\nIf you'd like to contribute to the this project,\r\nplease [open new ticket](https://github.com/MarcinOrlowski/DateTimeTemplate/issues)\r\n**before doing any work**. This will help us save your time in case I'd not be able to accept such changes. But if all is good and\r\nclear then follow common routine:\r\n\r\n* fork the project\r\n* create new branch\r\n* do your changes\r\n* send pull request\r\n\r\nLicense\r\n=======\r\n\r\n* Written and copyrighted \u0026copy;2013-2022 by [Marcin Orlowski](https://marcinorlowski.com)\r\n* DateTimeTemplate is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcinorlowski%2Fdatetimetemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcinorlowski%2Fdatetimetemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcinorlowski%2Fdatetimetemplate/lists"}