Setting time from application

Hello all,

I wish to set the time and date of the system from my application. (I write code in C ).

How can it be done?

I found the function stime() - but it gets time in seconds as a parameter, and I don't know how to convert my time & date to seconds since EPOCH.

What's the best way of setting the date and time from my application ?

Thank you very much...