The basic is to turn both into proper xs:dateTime objects, then calculate the difference. This will give you a dayTimeDuration. Divide this by the dayTimeDuration of 1 second and you have your difference in seconds. Example:
<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="now"
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T',get-property('SYSTEM_DATE', 'HH:mm:ss')) "/>
<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="12pm"
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T12:00:00')"/>
<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="diff"
expression="xs:dayTimeDuration(xs:dateTime(syn:get-property('now'))-xs:dateTime(syn:get-property('12pm'))) div xs:dayTimeDuration('PT1S')"/>
Keep in mind you need to enable xpath 2.0 for this on the ESB/EI. You can do this by uncommenting the following line in your [WSO2CARBON_HOM]/repository/conf/synapse.properties file.
#synapse.xpath.dom.failover.enabled=true
Also keep in mind that once you have done that, xpath expression where you combine functions from synapse namespace (like get-property) with normal xpath functions will require the use of a prefix like in the code example.