How can I do that with datetime?

Can anyone help?