Can i get my device time?

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

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

2 Likes

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

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

1 Like

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

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