Questions tagged [android-jodatime]
58 questions
0
votes
1 answer
Get Monday of last week with JodaTime
I need get Monday of last week E.g
Today is 28/11/18 (wednesday)
I need get 19/11/18 (monday)
I know that I can obtain Monday of the current week with
val monday = DateTime().withDayOfWeek(DateTimeConstants.MONDAY)

Erick Daniel Juarez Gil
- 47
- 1
- 6
0
votes
0 answers
java.lang.NoClassDefFoundError: at net.a.a.a.a.a (JodaTimeAndroid.java:39)
I have error reports on 18-19 API level:
java.lang.NoClassDefFoundError:
at net.a.a.a.a.a (JodaTimeAndroid.java:39)
at io.apptitude.premiumparking.App.initJodaTime (App.java:131)
at io.apptitude.premiumparking.App.onCreate (App.java:73)
at…

Nail Shaykhraziev
- 452
- 2
- 13
0
votes
1 answer
JodaTime confused about TimeZone offset
I receive a Date String like "2018-06-21T13:30:00Z"
I parse it with the pattern "yyyy-MM-dd'T'HH:mm:ssZ"
I am in GMT+2 and the result looks like 2018-06-21T15:30:00.000+02:00
while i expected it to look like this 2018-06-21T13:30:00.000+02:00
Is the…

Flo We
- 325
- 2
- 12
0
votes
2 answers
Time zones - how to?
The final goal is to convert a timestamp passed down from the server to local time.
Here's what I get:
2018-04-05T16:14:19.130Z
However, my local time is 11:14 AM CST. Here's what I've tried:
final DateTimeFormatter formatter =…

nullbyte
- 1,178
- 8
- 16
0
votes
1 answer
Compare time using JodaTime in Android
I need to compare whether a DateTime object is greater/less than 9AM PST using JodaTime library in Android.
I am getting the DateTime object in PST like this:
DateTime dt = new DateTime(DateTimeZone.forID( "America/Los_Angeles" ));
How can I…

user2284140
- 197
- 1
- 4
- 18
0
votes
0 answers
JodaTime parsing malformed at "PM" - but only on real device (works fine in local test)
I am using JodaTime 2.9.9:
implementation 'joda-time:joda-time:2.9.9'
I am parsing the same Date/Time string in in a Local UnitTest (test) and on an Instrumented UnitTest (androidTest).
The parsing code is:
String testString = "1/25/2018 5:03:12…

RumburaK
- 1,985
- 1
- 21
- 30
0
votes
1 answer
Possible wrong result from JodaTime
I'm using JodaTime for Android (link) and I'm trying to calculate the Period between two dates.
One date is from server with Europe/London timezone and the other date is one I create like :
DateTimeZone dateTimeZone =…

Mes
- 1,671
- 3
- 20
- 36
0
votes
1 answer
Joda Time .isAfter() producing incorrect result
I am getting some strange results from Joda Time and I am not sure what is causing it.
I am comparing two datetimes (alarm end and stop time) to ensure the user doesn't set an alarm to end before it starts.
I used the is .isAfter() but it seem to be…

Nicholas Muir
- 2,897
- 8
- 39
- 89
0
votes
1 answer
Joda DateTime doesn't set date correctly via milliseconds
I am providing a millisecond data 1473080981L which should date to: September 5, 2016 9:50 PM. I am doing unit testing and this was my first time to play around with JUnit. What I noticed so far is that every time I call:
DateTime dateTime = new…

Neon Warge
- 1,817
- 6
- 29
- 53
0
votes
5 answers
On updating android stdio,Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException:
Today when i had updated my android stdio , then i had seen following error , i can not understand cause for these error but it is giving a lot of
truble .
Error:Execution failed for task ':app:dexDebug'.
>…

Shubham Sharma
- 2,763
- 5
- 31
- 46
-1
votes
1 answer
Change Datetime by joda does not work- no error message and Time remains unchanged
I want to change datetime in my android app using joda Datetime using my below code.
steps:
get current date of system
set system hours
get current date and check the result.
There was no error pop-up while running this app.
But the time was not…

BBMM
- 11
- 4
-1
votes
2 answers
How to convert GMT +09:00 to local time?
When I print date that I get from server, it shows Mon Jun 24 16:15:31 GMT+09:00 2019
val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
val date: Date? = formatter.parse(checkedDate) // date from server
val transformedDate =…

c-an
- 3,543
- 5
- 35
- 82
-2
votes
1 answer
Why does calling DateTime.withTime() from another method cause an exceptionInInitializerError
This code worked until just a couple days ago. Now it no longer works on android version 6.0. It does work on version 7.0 and newer.
public void setToDate(String quickDate) {
DateTime toDate = new DateTime();
if…

Dan Anderson
- 1,062
- 13
- 26