grizzled.datetime.DateTimeUtil.scala Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of grizzled-scala_2.12 Show documentation
                Show all versions of grizzled-scala_2.12 Show documentation
A general-purpose Scala utility library
                
             The newest version!
        
        package grizzled.datetime
import java.util.{Calendar, Date}
/** Some basic date- and time-related helpers.
  */
object DateTimeUtil {
  /** Convert a `Date` object to a `java.util.Calendar` object.
    *
    * @param date the `Date` object
    *
    * @return the `Calendar` object
    */
  def dateToCalendar(date: Date): Calendar = {
    val cal = Calendar.getInstance
    cal.setTime(date)
    cal
  }
}
    © 2015 - 2025 Weber Informatics LLC | Privacy Policy