{"id":3643,"url":"https://github.com/dlew/joda-time-android","last_synced_at":"2025-05-13T18:14:36.281Z","repository":{"id":13064689,"uuid":"15745219","full_name":"dlew/joda-time-android","owner":"dlew","description":"Joda-Time library with Android specialization","archived":false,"fork":false,"pushed_at":"2025-03-28T02:46:34.000Z","size":4047,"stargazers_count":2630,"open_issues_count":3,"forks_count":183,"subscribers_count":61,"default_branch":"main","last_synced_at":"2025-05-13T09:56:27.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlew.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2014-01-08T19:11:09.000Z","updated_at":"2025-05-02T16:52:16.000Z","dependencies_parsed_at":"2024-02-05T03:38:30.156Z","dependency_job_id":"5f4ab910-ce5a-405a-b6f6-011eb41a5693","html_url":"https://github.com/dlew/joda-time-android","commit_stats":null,"previous_names":[],"tags_count":66,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlew%2Fjoda-time-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlew%2Fjoda-time-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlew%2Fjoda-time-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlew%2Fjoda-time-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlew","download_url":"https://codeload.github.com/dlew/joda-time-android/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000885,"owners_count":21997443,"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","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":[],"created_at":"2024-01-05T20:16:47.287Z","updated_at":"2025-05-13T18:14:36.251Z","avatar_url":"https://github.com/dlew.png","language":"Java","funding_links":[],"categories":["Other","Time","CN","Java","Libraries","etc","Libs","Security"],"sub_categories":["[Daniel Lew](https://github.com/dlew)","Date \u0026 Time","\u003cA NAME=\"Utility\"\u003e\u003c/A\u003eUtility"],"readme":"joda-time-android\n=================\n\nThis library is a version of [Joda-Time](https://github.com/JodaOrg/joda-time) built with Android in mind.\n\nWhy Joda-Time?\n==============\n\nAndroid has built-in date and time handling - why bother with a library?  If you've worked with Java's Date and Calendar classes you can probably answer this question yourself, but if not, check out [Joda-Time's list of benefits](http://www.joda.org/joda-time/#Why_Joda-Time).\n\nFor Android developers Joda-Time solves one critical problem: stale timezone data.  Built-in timezone data is only updated when the OS is updated, and we all know how often that happens.  [Countries modify](http://www.bbc.co.uk/news/world-europe-15512177) [their timezones](http://www.heraldsun.com.au/news/breaking-news/samoa-to-move-the-international-dateline/story-e6frf7jx-1226051660380) [all the](http://www.indystar.com/apps/pbcs.dll/article?AID=/20070207/LOCAL190108/702070524/0/LOCAL) [time](http://uk.reuters.com/article/oilRpt/idUKBLA65048420070916); being able to update your own tz data keeps your app up-to-date and accurate.\n\nWhy This Library?\n=================\n\nI know what you are thinking: Joda-Time is a great library and it's just a single JAR, so why make things more complex by wrapping it in an Android library?\n\nThere is a particular problem with the JAR setup on Android: due to its usage of [ClassLoader.getResourceAsStream()](http://developer.android.com/reference/java/lang/ClassLoader.html#getResourceAsStream%28java.lang.String%29), it greatly inflates its memory footprint on apps.  (For more details, see [this blog post](http://blog.danlew.net/2013/08/20/joda_time_s_memory_issue_in_android/).)  This library avoids the problem for Android by loading from resources instead of a JAR.\n\nThis library also has extra utilities designed for Android.  For example, see [DateUtils](library/src/main/java/net/danlew/android/joda/DateUtils.java), a port of Android's [DateUtils](http://developer.android.com/reference/android/text/format/DateUtils.html).\n\nUsage\n=====\n\nAdd the following dependency to `build.gradle`:\n\n```groovy\ndependencies {\n    implementation 'net.danlew:android.joda:2.13.1'\n}\n```\n\nMulti-Process Apps\n===============\n\nDue to using App Startup, joda-time-android will not automatically initialize in non-main processes.\n\nIf you would like to automatically run App Startup in other processes, add this to your manifest:\n\n```xml\n\u003cprovider\n    android:name=\"androidx.startup.InitializationProvider\"\n    android:authorities=\"${applicationId}.androidx-startup\"\n    android:exported=\"false\"\n    android:process=\"[your-process-name-here]\"\n    tools:node=\"merge\" /\u003e\n```\n\nAlternatively, you can call [`AppInitializer`](https://developer.android.com/reference/kotlin/androidx/startup/AppInitializer) directly to initialize just joda-time-android:\n\n```kotlin\nAppInitializer.getInstance(this).initializeComponent(JodaTimeInitializer::class.java)\n```\n\nTroubleshooting\n===============\n__Q: My build fails with an error about a duplicate file__\n\n\u003e Duplicate files copied in APK META-INF/LICENSE.txt\n\nor\n\n\u003e Duplicate files copied in APK META-INF/NOTICE.txt\n\n__A: We can safely exclude those files from our build. You need to specify these two `exclude`s in your `build.gradle` file and you will be good to go:__\n\n```\nandroid {\n    ...\n    packagingOptions {\n        exclude 'META-INF/LICENSE.txt'\n        exclude 'META-INF/NOTICE.txt'\n    }\n}\n```\n\nor \n\n__B: We can safely choose to add those files to our build. You need to specify these two `merge`s in your `build.gradle` file and you will be good to go:__\n\n```\nandroid {\n    ...\n    packagingOptions {\n        merge '**/LICENSE.txt'\n        merge '**/NOTICE.txt'\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlew%2Fjoda-time-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlew%2Fjoda-time-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlew%2Fjoda-time-android/lists"}