Questions tagged [android-jodatime]
58 questions
0
votes
1 answer
Joda Time on android causing IllegalArgumentException
Description: The following method is supposed to get the date of the last inventory count from Firestore, and execute proceedWithInventoryMode() if it's been at least 24 hours.
private void checkIf24HourReached() {
LocalDateTime now =…

Alula48
- 37
- 6
0
votes
1 answer
Joda lib in production
Since Java 8 release, it is recommended to migrate to Java Date APIs. We still continue to support Android API level 23, is it advisable to continue using Joda in production?

Varsha Kulkarni
- 1,389
- 2
- 13
- 17
0
votes
0 answers
Android : Proguard build is failing for joda time
I am getting the following error when I build the app with proguard. This failure is new. I updated some of the libraries used in the app to latest (including the target and compile sdk version to 30)but the joda library version is not changed. It…

png
- 4,368
- 7
- 69
- 118
0
votes
1 answer
How can I change my date format using org.joda.time.LocalDate in android studio?
Basically, I want to get the date of Monday from the current day of the week.
eg: today is Tuesday and I want a Monday date, I'll get that required date from the following code lines:
val now = LocalDate()
val monday: LocalDate =…

Usama Hafeez Official
- 171
- 3
- 13
0
votes
1 answer
JodaTime and Daylight saving time
I develop a custom schedule calendar, with 30 minutes gap, so when i generetae this by adding 30 minutes:
date = date.plusMinutes(minuteStep)
so in moment when our time zone switch to Daylight saving time, jodatime add 1 hour to current time and in…

Александр Волошиновский
- 1,123
- 8
- 21
0
votes
1 answer
How to mock system date with joda time
I am writing a UI test for a flow that makes use of the current date to do some processing. Here's how I get the current date in my fragment:
val today = dateFormat.format(Date())
In my test, I want to use a fixed date. To this end, I decided to…

Taslim Oseni
- 6,086
- 10
- 44
- 69
0
votes
1 answer
Get a dateTime before some hours from a specified dateTime Kotlin Android
I want to get a dateTime which is some hours before the specified datetime. The datetime will be in string format and depending on configuration, need a datetime n hours before the given time( example 3 or 4 hours before the given time).
The time…

Joseph
- 1,060
- 3
- 22
- 53
0
votes
1 answer
Display time interval in minutes using joda Date time to display in Calendar
I want to display list of time interval with 15 minutes or 30 minutes like
like
1:00
1:15
1:30
1:45
or
1:00
1:30
2:00
2:30
below code is using Joda Date time library and it's showing time with interval of hours . I simply want to display time…

Zar E Ahmer
- 33,936
- 20
- 234
- 300
0
votes
1 answer
parsing DateTime with ThreetenBp causes DateTimeParseException or incomplete string error
I am trying to check if the date has passed more than one day or not.
And I got these errosr while it parses the string.
java.lang.IllegalArgumentException: Pattern ends with an incomplete string literal:…

c-an
- 3,543
- 5
- 35
- 82
0
votes
2 answers
how to convert multiple EditText value into one date String in android studio?
its an age calculator project I need to know how to convert multiple EditText values into one date String in an android studio? keep in mind I am using "joda-time library" it's not showing the result. I don't know where I did a mistake! I have…

MD Tayobur Rahman
- 96
- 9
0
votes
1 answer
Cannot get the correct difference between two time stamps using Joda time
I am working with Joda time android and when I try to get the difference between two time stamps, the value increments from 0 to 59 and it never goes beyond that.
I am using https://github.com/dlew/joda-time-android
Any pointers would be much…

BRDroid
- 3,920
- 8
- 65
- 143
0
votes
1 answer
How to get only date type without time?
I want to use Date type as Id in Room database, The main reason for this is to be able to check if this date is today. Any suggestion is appreciate
@Entity
data class DailyCount(@PrimaryKey
var date:DateTime,// JodaTime
…

Nurseyit Tursunkulov
- 8,012
- 12
- 44
- 78
0
votes
1 answer
Joda Time hour interval
I get time from server in format { "from" : "12-00", "to" : "01-00" }
Then, I parse it like this
DateTimeFormat.forPattern("HH:mm").parseDateTime(dateString)
Then, I need to check if current time is in this hour range:
Interval(from,…

Vladislav Shcherbakov
- 696
- 9
- 14
0
votes
1 answer
Joda parsing a 24h time pattern with correct DateTimeZone
Once more I am struggling with timestamps, dates etc.
I have following class:
public class TimeConverter {
private static final String TAG = TimeConverter.class.getSimpleName();
public static final String PATTERN_TIME_24H = "HH:mm";
…

AZOM
- 265
- 5
- 15
0
votes
2 answers
How to parse String date to other date for other timezone
Given I have such String date
val date = "2019-01-07T13:54:00+0000"
How to parse this date to other timezone e.g "Asia/Kolkata"?
I was trying:
val zone = DateTimeZone.forID("Asia/Kolkata")
val resultMillis = ISODateTimeFormat
…

K.Os
- 5,123
- 8
- 40
- 95