How can I convert a Long value to date time and convert current time to Long kotlin? : <p>The Code A can convert a long value to date value, just like 2018.01.10</p>

<ol>
<li><p>I hope to get Date + Time value , such as 2018.01.10 23:11, how can I do with Kotlin? </p></li>
<li><p>I hope to convert current time to a long value , how can I do with Kotlin? </p></li>
</ol>

<p>Thanks!</p>

<p><strong>Code A</strong></p>

<pre><code>fun Long.toDateString(dateFormat: Int =  DateFormat.MEDIUM): String {
    val df = DateFormat.getDateInstance(dateFormat, Locale.getDefault())
    return df.format(this)
}
</code></pre>
