Questions tagged [joda-convert]

13 questions
5
votes
5 answers

Convert String to LocalDate

I want to convert 21022019 to 2019-02-21, but some reason I am not able to convert. import org.joda.time.LocalDate; import org.joda.time.LocalDateTime; import org.joda.time.format.DateTimeFormat; public class StringToLocalDate { public static…
Uday Kiran
  • 487
  • 2
  • 9
  • 29
4
votes
1 answer

Scala/Java joda.time not converting date in 24 hours format

I am trying to convert a long utc value into "yyyy-MM-dd HH:mm:ss" formatted pattern. I am expecting my data to be converted on 24 hours range scale and in GMT. My code passes all the test cases, I push the data into database using the jar that is…
a13e
  • 838
  • 2
  • 11
  • 27
2
votes
1 answer

Convert 12 hour time to 24 hour using Joda time

I am getting this error Invalid format: "09:30 PM" is malformed at " PM" LocalTime start = new LocalTime(); LocalTime end = new LocalTime(); DateTimeFormatter formatter = DateTimeFormat.forPattern("hh:mm a"); start =…
Swanand Keskar
  • 1,023
  • 1
  • 13
  • 27
2
votes
1 answer

JodaTime issues with scala and spark when invoking spark-submit

I am having trouble using JodaTime in a spark scala program. I tried the solutions posted in the past in Stackoverflow and they don't seem to fix the issue for me. When I try to spark-submit it comes back with an error like the following: …
Sai
  • 3,819
  • 1
  • 25
  • 28
1
vote
1 answer

Convert from joda.Datetime to time.LocalDateTime is the right way?

I need timestamp format for my dates in database. For now i have joda.Datetime in database , but also in my restApi application. I tried to create a new column , and converted the existing joda.Datetime in the other column time.LocalDateTime. Also I…
Buda Sergiu Flavius
  • 210
  • 1
  • 3
  • 13
0
votes
0 answers

Is any Joda library method is there to convert Joda.Money to Pennies?

I want to convert Joda.Money to pennies. Is there any Joda library method available? Sample input: USD 233.33 Sample output: 23333 Tried below 2 options: tried with Money.getAmountMinorInt() and it's returning with multiplies of 100. getAmount…
Remo
  • 534
  • 7
  • 26
0
votes
0 answers

value parse is not a member of object org.joda.time.DateTime

While Building My code in jenkins , I am getting following error, value parse is not a member of object org.joda.time.DateTime [ant:scalac] var broadcastDate = DateTime.parse(attributesMap("processingDate"),…
Aditya Dhanraj
  • 189
  • 1
  • 1
  • 12
0
votes
1 answer

Scala, convert joda.LocalDateTime to json with play 2.5

I'm new to Scala and my question is about Json serialization using play (2.5) for Joda's optional value My Inputs: 1. import org.joda.time.LocalDateTime case class User( name: String, lastLogin:…
nikabu
  • 127
  • 1
  • 6
0
votes
2 answers

java.lang.StackOverflowError at org.joda.time.chrono.BasicChronology.getYear(BasicChronology.java:426)

Could someone tell me what I am doing wrong for getting this StackOverFlowError with Joda library? Here the code implyed: public Integer getAge() { if ( getBirthDate() != "//" ) { try { LocalDate birth = LocalDate.parse(…
akuma8
  • 4,160
  • 5
  • 46
  • 82
0
votes
1 answer

How to convert or deserialize org.joda.time.LocalDateTime to milliseconds using Thymeleaf?

I have Thymeleaf code (this code need for me to add parameter for JQuery - DatePicker): now page looks like: data-availible-dates="[2014-01-09T00:00:00.000,…
Max Usanin
  • 2,479
  • 6
  • 40
  • 70
0
votes
2 answers

How can i format joda DateTime in this style "yyMMddHHmmss"?

i tried doing this: DateTime dt=new DataTime(DatetimeZone.UTC); DateTimeFormatter diff=DatTimeFormat.forPattern("yyMMddHHmmss"); DateTime jtime=diff.ParseDateTime(dt.toString()); But am getting illegal argument exception. please help me…
Karthik Suresh
  • 367
  • 7
  • 23
-1
votes
1 answer

openHAB two Strings to DateTime

I have two String variables (one has date and other has time), how can I create DateTime from these two String variables ? The purpose to use PlusMintues PlusDay ... Can you help me please ?
Ahmad Z. Tibi
  • 419
  • 2
  • 8
  • 19
-2
votes
1 answer

Converting from Joda to Java time

I need to convert joda time to Java time but having some issues My joda time code : p.s method is a long type (long argDateString) DateTime istime = new DateTime(argDateString*1000); DateTime NormalTime =…