All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.crobox.clickhouse.partitioning.PartitionDateFormatter.scala Maven / Gradle / Ivy

There is a newer version: 1.2.5
Show newest version
package com.crobox.clickhouse.partitioning

import java.util.Date

import org.joda.time.{DateTime, LocalDate}
import org.joda.time.format.DateTimeFormat

object PartitionDateFormatter {
  private val formatter = DateTimeFormat.forPattern("yyyy-MM-dd")

  def dateFormat(ts: Long): String = formatter.print(ts)

  def dateFormat(dt: LocalDate): String = formatter.print(dt)

  def dateFormat(dt: DateTime): String = dateFormat(dt.getMillis)

  def dateFormat(dt: Date): String = dateFormat(dt.getTime)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy