field 22 of /proc/1/stat has the start time of the container (in jiffies)
field 22 of /proc/self/stat has the current time (in jiffies)
so...
$(( ( $(cut -d' ' -f22 /proc/self/stat) - $(cut -d' ' -f22 /proc/1/stat) ) / 100 ))
gives you the container uptime in seconds.