When talking about time durations, can we use at ... to? For example:
The class is at 5pm to 6pm.
I know the ideal use would be:
The class is from 5pm to 6pm.
The problem here is that at only works for one specific referent (literally, a single location in space; metaphorically, one moment in time). It's not suitable for a range of locations / times.
As OP recognises, from [StartTime] to [EndTime] is a valid usage. I wouldn't say it's "ideal" though - it's just one alternative to consider when making what's essentially a stylistic choice.
In many contexts (including OP's exact example), between [StartTime] and [EndTime] could be a good choice. But that won't always work, because sometimes it might be understood to mean that the [class, whatever] starts at some point within that time span (and finishes at an unspecified time which might be within or beyond that range). But it's also fine to dispense with the first preposition entirely...
The class is 5pm to 6pm.
I would probably say that the class starts at 5pm and finishes at 6pm
The one hour [long] class is at 5pm
?