casbloem / vue-luxon

Easy use of datetime with Luxon in Vue
https://npmjs.com/package/vue-luxon
72 stars 8 forks source link

timestamp (unix epoch) support? #15

Closed tigrankhachikyan closed 4 years ago

tigrankhachikyan commented 4 years ago

Is there a way to read from timestamp (unix epoch) i.e. 1600454930.97649 and format to say 'ymd'? The Luxon itself seems has method fromMillis https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#static-method-fromMillis

I'm trying to do something like

// datetimeVariable =  '1600454930.97649' // i.e. Fri, 18 Sep 2020 20:06:49 GMT

{{ datetimeVariable | luxon:full }}

Am I doing something wrong, or this is not supported?

Thanks!

casbloem commented 4 years ago

In version 0.7.4 i've added seconds (or unix) and millis to format/parse Unix timestamps.