I am trying to cast com.github.nscala_time.time.Imports.DateTime from nscala-time (a wrapper of joda-time) to java.util.Date
activeUntil.toDate()
But I get this error
value toDate is not a member of Option[com.github.nscala_time.time.Imports.DateTime]
Obviuosly is not the right way to do it. Is there a way to do this?
Thank you in advance
                        
Apparently
activeUntilis anOption[DateTime]notDateTimeitself. You canmapit toDateand get providing some default value in caseOptionis empty like thisI am not sure where did you get
activeUntilfrom, but probably from a method that can fail to give you yourDateTimethis is why it returned anOptionand forced you to handle the case when there is nothing to return.