Better date format (probably going to make it settable)

This commit is contained in:
Nikola Bjelo committed 2018-10-29 12:08:16 +01:00
1 parent 15106771f2
commit 347848154a
1 file changed
+2 -1
+2 -1
View File
@@ -1,5 +1,6 @@
export const toLocalTime = (epoch) => {
let localDate = new Date(0)
localDate.setUTCSeconds(epoch)
return localDate.toString()
var options = { year: 'numeric', month: 'long', day: '2-digit' }
return localDate.toLocaleDateString(options) + ' ' + localDate.toLocaleTimeString('en-US')
}