package com.qimai.android.tools

import java.text.SimpleDateFormat
import java.util.*

/**
 *   created by wangwei   ON 2019-09-23  email:wangwei_5521@163.com
 *   @version 1.1.1
 *   @Description
 **/



fun formatCurrentDate(pattern: String) = getTimeFormatStr(pattern)

 fun getTimeFormatStr(pattern: String, original: Any = Date()) =
    SimpleDateFormat(pattern, Locale.getDefault()).format(original)
        ?: ""

/**获取当前年份**/
val currentYear: Int
    get() = Calendar.getInstance().get(Calendar.YEAR)

/**获取当前月份**/
val currentMonth
    get() = Calendar.getInstance().get(Calendar.MONTH) + 1


/**获取当前日**/
val currentDay: Int
    get() = Calendar.getInstance().get(Calendar.DATE)

/**获取当前时间戳**/
val currentTimeMillis: Long
    get() = System.currentTimeMillis()
