Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

more preprocessors: Unix Timestamp / Date.now() #63

Closed
rriemann opened this issue Jul 10, 2014 · 4 comments
Closed

more preprocessors: Unix Timestamp / Date.now() #63

rriemann opened this issue Jul 10, 2014 · 4 comments

Comments

@rriemann
Copy link

In my angular app I'm using Linux Timestamps generated by Date.now().

Is it possible to add the adequate preprocessor for this? (simply /1000 to existing unix preprocessor). moment.js itself supports both as well.

Best,
Robert

@pmackay
Copy link

pmackay commented Aug 7, 2014

+1 for this. Would it be possible to have a configurable processor, so the parsing format of the input date could be defined?

@caseprince
Copy link

I was also having this issue, and was able to work around it by NOT specifying angularMomentConfig. Seems GMT Linux timestamps are the default?

@roberthunt
Copy link

It appears to work by default as @caseprince mentioned, I store time and date in a database as a long integer representing milliseconds since unix epoch in UTC and it was able to format them fine using:
{{myObj.unixMilliseconds | amDateFormat:'dddd, MMMM Do YYYY, h:mm:ss a'}}

@urish
Copy link
Owner

urish commented Sep 15, 2015

These time stamps are indeed supported natively. In addition, as of 1.0.0, you can use the amParse filter to specify a custom format.

@urish urish closed this as completed Sep 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants