Can i get my device time?


#1

I want to compare the server time with the device time, and calculate the diference.


#2

You can simply use JavaScript Date object, it will use your device information.


#3

Thanks Gajotres! I was very tired yesterday. :smile:


#4

You can create a services which return server time and you can get local time in javascript with

$scope.currentDate = new Date();

Then you can calculate


#5

I use this - http://momentjs.com
Or can use angular module - https://github.com/urish/angular-moment


#6

You are using angular , so its better to use angular directive , use - https://github.com/urish/angular-moment