NickName:Baek Ryun Ask DateTime:2016-12-01T09:44:37 Getting global (UTC or GMT) time in angularjs and not local time Is there any way to do this in angular js or just javascript? Getting a time that does not depend on the local date of the PC? The only solution I could think of was to constantly make requests to the back-end so it would use the server's time and not the client-side local time but it's not really a solution as it would require to constantly make requests, which clearly sucks as it's a brute force method that doesn't really yield the desired result since the requests obviously have delay. Copyright Notice:Content Author:「Baek Ryun」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/40901290/getting-global-utc-or-gmt-time-in-angularjs-and-not-local-time Answers Ali Kareem Raja 2016-12-01T07:18:24 //converts local time to UTC (Universal Time)\nfunction toUTC(/*Date*/date) {\n return Date.UTC(\n date.getFullYear()\n , date.getMonth()\n , date.getDate()\n , date.getHours()\n , date.getMinutes()\n , date.getSeconds()\n , date.getMilliseconds()\n );\n} //toUTC()\n\n\nThis function will give you the unix epoch ticks in UTC (thanks to: http://blog.davidjs.com/2011/05/convert-local-time-to-utc-time-in-javascript/)\n\nIf you need to display this in a user friendly way please consult the reference: http://www.w3schools.com/jsref/jsref_obj_date.asp\n\nGood luck!",