javascript - Showing update time like Twitter's update notification -


i using momentjs finding difference specific date below:

moment([mydate]).fromnow(); 

the code gives me results below:

"a few minutes ago" or "10 hours ago" ...

i tried change below find difference seconds

moment([mydate]).fromnow().asseconds(); 

but code doesn't work.

so implement codes twitter's last update notification. suggestion?

if want make diff between 2 dates in seconds : moment().diff(mydate, 'seconds')


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -