Time stamps

Hello everybody,
I have just started developing my project and I have hit my first roadblock, maybe you can help me. My application detects pulses from a sensor, I would like to time stamp each one of them so I could perform date based operations on the imp and decide what to do with the data. Is this possible?
I am connecting to a rails backend and one solution I imagined was to do the date operations on the server and then send the result as an input parameter to the imp, but this would mean having to go to the server to decide.
Any suggestions are greatly appreciated.

Thanks a lot in advance!

// Register with the server
imp.configure(“Timestamp”, [], []);

local d = date();
local datestring = format("%04d%02d%02d-%02d:%02d:%02d", d.year, d.month+1, d.day, d.hour+2, d.min, d.sec);

// Display our important message
server.log(datestring);

// End of code.

Thank you, that did it!

sorry, I made a mistake. If you need a timezone correction, use the following code:

`// Register with the server
imp.configure(“Timestamp”, [], []);
local timezone = 2; //GMT+02
local d = date(time() + (timezone6060)); // get the date in your timezone
local datestring = format("%04d%02d%02d-%02d:%02d:%02d", d.year, d.month+1, d.day, d.hour, d.min, d.sec);//e.g. 20130511-00:57:25

// Display your important message
server.log(datestring);

// End of code.
`

you also can write a function for daylight savings correction

No worries, I did catch that one up. Thanks!