Questions tagged [threetenbp]

ThreeTen-Backport is the backport of JSR-310 to Java SE 7. Questions about "java.time" in Java SE 8 should use the [java-time] tag. Only questions specifically about the backport should use this tag.

ThreeTen-Backport is the backport of JSR-310 to Java SE 7. Questions about java.time in Java SE 8 should use the tag. Only questions specifically about the backport should use this tag.

95 questions
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
1 answer

How to parse time stamp and time zone offset simultaneously with Moshi?

A JSON-API-response contains the following properties: created_at_timestamp: 1565979486, timezone: "+01:00", I am using Moshi and ThreeTenBp to parse the time stamps and prepared the following custom adapters: class ZonedDateTimeAdapter { …
JJD
  • 50,076
  • 60
  • 203
  • 339
0
votes
1 answer

What's the time format of now() in Threeten?

I use ThreeTen module and when I print ZonedDateTime.now(), I get. 2019-07-11T22:43:36.564-07:00[America/Los_Angeles] What's the format of this? I tried uuuu-MM-dd'T'HH:mm:ss.SSS'Z' and It says, org.threeten.bp.format.DateTimeParseException: Text…
c-an
  • 3,543
  • 5
  • 35
  • 82
0
votes
0 answers

how to edit threeTenAbp library

I'm using threeTenAbp library to create a calendar. but I need to change some codes in 'LocalDate.java', a class of threeTenAbp library. I clicked in 'copy path' and get this…
Mohammad Derakhshan
  • 1,262
  • 11
  • 33
0
votes
0 answers

SimpleDateFormat creating 4 digit month

We have code very much like the code below where we take a java.util.Date and minus a certain amount of seconds from the date and store it as a string in a sqlite db: private static final String DB_DATE_FORMAT_STRING =…
Jeff
  • 2,198
  • 3
  • 21
  • 38
0
votes
1 answer

Conflicts while displaying dates in Android using ThreeTen

I have using ThreeTen in android for displaying 1-week dates from the current date. However, the problem is dates are not displaying in the correct order. Here's my code for days 1 week dates from the current date: public List
Lets Explorer
  • 123
  • 1
  • 2
  • 13
0
votes
1 answer

Text could not be parsed at index 33

I am working on ThreeTenABP library to parse date and time. However, it is crashing. API I consume sends DateTime like; 2018-10-20T14:27:47.3949709+03:00 This is the way I try to parse; DateTimeFormatter formatter = new DateTimeFormatterBuilder() …
nuhkoca
  • 1,777
  • 4
  • 20
  • 44
0
votes
1 answer

How to display local date type using recycle view in android?

I'm using the Threeten time zone to store the local date in a list of the LocalDate type. Here's my code : private List getWeekDays() { ZoneId z = ZoneId.of("Pacific/Auckland"); // Or ZoneId.of( "Africa/Tunis" ) …
Lets Explorer
  • 123
  • 1
  • 2
  • 13
0
votes
1 answer

android.app.Application cannot be cast to android.app.Activity in fragment

I'm using Threeten time zone for fetching the date and time in android. But get an error at AndroidThreeTen.init((Application) getContext()); the error is "java.lang.ClassCastException: moneytracker.karthik.example.moneytracker.Display.ViewCash…
Lets Explorer
  • 123
  • 1
  • 2
  • 13
0
votes
1 answer

org.threeten.bp.format.DateTimeParseException: Text '2018-07-22T14:00:00-03:00' could not be parsed at index 19

public static String formatter(String dateInPattern, String dateOutPattern) { OffsetDateTime dateInPatternFormat = OffsetDateTime.parse(dateInPattern, DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ")); Date dateInValue =…
0
votes
3 answers

How can I change java.util.Date to ISO String using ThreeTenABP

I'm using ThreeTenABP for converting date time for Android. My question is how can I change a java.util.Date to an ISO String (format is 2018-05-24T02:33:10.062Z) by ThreeTenABP?
amlwin
  • 4,059
  • 2
  • 15
  • 34
0
votes
2 answers

How to handle LocalDate Period.between results?

I use LocalDate (ThreeTenABP) to calculate the period between to given dates. When I use 01/01/2018 as the first and 12/31/2018 as the second date, Period.between gives the following result: 00 years 11 months 30 days IMHO this is wrong, since a…
DMP
  • 23
  • 4
0
votes
0 answers

JS-Joda / LocalTime support for days with more than 24 hours

GTFS feeds do not operate on the basis of a 24 hour day, for instance a trip that departs at 23:00 may arrive at 24:30 (more details). LocalTime only supports 24 hour days - is there another construct that does support days with more than 24 hours?…
Linus Norton
  • 557
  • 1
  • 4
  • 15
0
votes
0 answers

get time from devices local time using offset variable

Hello I am using the threeten library that provides me with the object org.threeten.bp.OffsetDateTime. The application works great when I am on EST time, but when I manually change my device to Pacific time to make sure the times are being displayed…
paul590
  • 1,385
  • 1
  • 22
  • 43
0
votes
1 answer

ThreeTenBP DateTimeParseException

I am trying to convert a date String from the server to dateTime with ThreeTenBP. My method looks like this: String toDateTime(String dateString) { DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendPattern("M/d/yyyy h:mm…
IgorGanapolsky
  • 26,189
  • 23
  • 116
  • 147