Extracting unix time from the rtc widget

Has someone needed to convert the output from the RTC module to unix time before? if so, how has this been done? I have written a class for managing light levels based upon sun and moon position, moon phase etc. and it all works in seconds since 1970. Given that I suspect RTC converts its output to hour()/minute()/second() etc., I suspect that prior to that conversion it may in fact be unix time. I may be missing something really obvious here, and I would appreciate any advice one way or another.

Many thanks for your time and effort,
James

currently I have this, but it is inelegant:

getTime (){
  long nowSeconds = (((year()-1970)*31557600) + (month()*2629800) + (day()*86164) + (hour()*3600) + (minute()*60) + second());

}

I am not very sure but I believe that RTC uses the standard time library so now() gives you the now time in full unix style. Test it and let me know.

sever send to hardware time as unix format, than Time library use function setTime with that value. mikekgr is rigt, call now() and it give unix time in your local timezone

Awesome thanks both!