[help] How to change the system clock in program?

I want to write a program which works like the system clock, year, month , day can be changed manually but without using PtCalendar widget. How can I get that goal?
I look up the help and can only find clock_settime() function, but how can I change the struct tm to the structtimespec? On the other hand, can clock_settime change the system clock or not?
Thx a lot in advance!

This page has an example of usage:

qnx.com/developers/docs/mome … ttime.html

How about:

timespec.tv_nsec = 0;
timespec.tv_sec = mktime(&tm);

Thx a lot! Although can program like that:
system(“date $newdate”);
I don’t think that’s a good idea.
Thanks to Mr xtang, I find the answer of conversion.