Hey!
I’m using this code to display server time
if (Meteor.isClient) {
Meteor.startup(function () {
setInterval(function () {
Meteor.call("getServerTime", function (error, result) {
Session.set("time", result);
});
}, 1000);
});
Template.main.time = function () {
return Session.get("time");
};
}
if (Meteor.isServer) {
Meteor.methods({
getServerTime: function () {
var _time = (new Date).toTimeString();
console.log(_time);
return _time;
}
});
}
Now, the output is “17:22:18 GMT+0200 (CEST)”. How can i shorten that to only display for example 17:22?
Thanks in advance
- Glutch