You're right that こんにちは can be translated into "Good afternoon", but it's not always the case.
こんにちは could be used later in the morning (It seems that NHK, Japan Broadcasting Corporation, uses it after 9AM) where you wouldn't use "Good afternoon".
Thus, though こんにちは is not all-purpose as "hello" (which could be used in the evening), it is the closest (Unless we consider informal expressions like やあ). At least it would require some special context to say that a specific "hello" cannot be こんにちは. On the other hand, it also requires some special context to say that a specific "hello" would correspond to おはよう.