I want to develop a class which I can use without building an instance, like String. I want to use the class for conversation, e.g. "Serial.println (dateConvert (ulong unixEpoch).toMyFormat())", the output is as String.
Can you give an example of use of String that doesn't build an instance? (Trick question!)
Why do you want to develop a class for this? Why not just develop a function?
What is dateConvert() in your example? What type does it return?
You could develop a class which takes whatever type dateConvert() returns as a constructor parameter and has a toMyFormat() method. But why do that? It's less efficient than a normal function.
I suspect that what @franks_pv has in mind is using an object without having to explicitly create an instance of that object. This would be much as the same way that Serial and String work in the Arduino environment
Putting functions in a class could help to keep things together and help to prevent name collision. It may also improve the ease of reuse.
I agree that on AVR the extra (memory/processing) cost of a class may be a drawback. But on ESP32 it is not that easy to fill all memory... and the extra memory for the class will be negligible...
After typing foo:: IDE will even suggest bar and fiz
If there are no member fields, then no point in using class or struct. static member functions are useful for wrangling instances as a whole, but not if there are never any instances.
While in the use case you're thinking of, it may appear that an instance isn't being created, it actually is! The instance is temporary and destroyed after its use in the statement.
It's the answer to OP's question .... a working example of the pattern that OP wants to implement. Whether or not it is "real world", practical, or useful is immaterial to the question and answer.