How can I get today's date and time in Meteor?

How can I get today's date and time like this DD.MM.YYYY and how to do it? to Meteor?

Template.getdate.helpers({
  datelist: function(){
    var bugun=date(now);
 return Rezervasyon.find({iadetarihi:bugun});

  }
});

      

+3


source to share


1 answer


You can use standard javascript for today's date:

var bugun=new Date();

      

To format it and get smaller fonts it's nice to use the momentjs package:

Add this to your meteor project:



meteor add momentjs:moment

      

Then you can do this instead of the above:

var date = new Date()
var begun = moment(date).format("MM.DD.YYYY");

      

+5


source







All Articles