Your comments

Maybe I wasnt clear enough. In my case I have only had issues when writing the "%H%M" format. That is, the %M is directly after %H. The following string will not give the visual bug: "%H:%M"

While i tested some more I found the problem to be more generic, it seems to be that any character that follows "%H%" will be colored as a normal string, not a part of the time-format. In other words, it does not seem like the %M is the actual problem, but rather the %H which was in front of it.

The placement does not seem to matter. The problem is consistent wheter it is the only part of the string, at the end or in the beginning of the string. 

I did try many of the other color-schemes. I had the same visual bug with all of them.

Using sublimetext 2 with the default Python color scheme. No setting changed but setting tabs to 4 spaces instead of tab. It happends on both my computes, where one is running Windows 7 and the other Linux Mint.

The actual command that gives the visual bug looks like this:

return theTime.strftime("%Y%m%d_%H%M.jpg")

changing it to return theTime.strftime("%H%M") gives the same bug.