-1

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

1 Answers1

0

I had tried this and it works,

val SimpleDateFormat dateFormatter = new SimpleDateFormat( "yyyy-MM-dd HH:mm" )        
val dateTimeString = dateValue + " " + timeValue
val String dateTimeValue = dateFormatter.format(new Date(dateTimeString))                
val DateTime origStartDate = new DateTime(dateFormatter.parse(dateTimeValue))
Ahmad Z. Tibi
  • 419
  • 2
  • 8
  • 19