Question: I just try to set a value datetime for input( It is for change the current value of variable date time), but my html show an error ( seems it's fault about the format):

the code is :

`<input type="datetime" name="deadline" required value ='<?php echo date('c', $dateDeadline); ?>'/>`

Thx a lot.

Answer: 
You could use `Deps.autorun`. (<http://docs.meteor.com/#deps_autorun>)

Usually `Deps.autorun` would run for your whole Meteor app. If you want to make it so that it only runs per template you would need to create and stop it in the rendered and destroyed template callbacks

e.g

```
var loginRun;

Template.bar.rendered = function() {
    loginRun = Deps.autorun(function() {
        if(Meteor.user()) {
            //Stuff to run when logged in
        }
    });
}

Template.bar.destroyed = function() {
    loginRun.stop();
}

```

If you don't need it to run per template (need it to run just once for you app on any template, then you can use the `Deps.autorun` on its own, anywhere in your client side code.

`Meteor.user()` is reactive, it would ensure that the Deps.autorun callback runs again when it changes, so you could theoretically use it to do things when the user logs in or out.

Other alternatives is there is a package on atmosphere that provides login and logout hooks, though they basically would use the Deps.autorun like above to work anyway. See <https://github.com/BenjaminRH/meteor-event-hooks>
My solution for similar problem was to 

1. Attach an event to template where the login happens
2. Re-render template if login is succesful so the `Template.bar.rendered` is called

E.g.

```
Template.bar.events({ 
   'click .loginButton' : function() {
    if( Meteor.call.Login( username, pw ) )
    {
        $('#bar').html( Meteor.render( Template.bar ));
        //jQuery is optional
    }
});

```