urish / angular-moment

Moment.JS directives for Angular.JS (timeago and more)
MIT License
2.6k stars 397 forks source link

Cannot convert local moment to UTC #163

Closed ramprakash-ravi closed 9 years ago

ramprakash-ravi commented 9 years ago

I'm trying to get unix timestamp and UTC converted for same for date using moment. But i'm getting same local values for both:

var local_date = moment();
var dateUnix = local_date.unix();
var dateUnixUTC = local_date.unix();

console.log(dateUnix);
console.log(dateUnixUTC);

//prints
1440056684
1440056684
urish commented 9 years ago
   var dateUnix = local_date.unix();
   var dateUnixUTC = local_date.unix();

These two lines are doing the exact same thing, so it makes sense that you will get the same result.

Anyway, this is not the place for moment.js related questions. Please use the official moment.js repository for moment.js related issues / questions. You can also ask on stackoverflow.