How to get the latest time in seconds with functions?

 
Dears, How to get the latest time in seconds with functions? e.g. if now the candle time is 2014.11.10 21:15:25, how to get it and transfer it to seconds? Thank you very much!
 

Like this?

  datetime now=TimeCurrent();
  int secs=(int)now; 
 
Dear GumRai, thankyou very much!