I was considering coding an indicator to detect the time frame of a chart but I was getting strange results on a 1 second chart. Here is a simple code that should calculate what the current seconds are from the open time but sometimes it returns a negative number for the seconds!
After a little further testing it seems that on a 20 second or 30 second or 40 second or 50 second chart it Calculates SS correctly but on any other chart it returns minus numbers.