How to create time variable in input plugin

Hello, I use http_poller plugin as an input plugin. I need to pass current hour and previous hour as parameter values to its url. I wondered how this could be done, since did not find any documentation on this.

Answered here.