Fetch current timing in agent code

Hi All,

Could you please guide me how to fetch current time in agent code?

Thanks

`local now = date();
server.log("Current time is " + now.hour + ":" + now.min + ":" + now.sec);`

Great thanks.