Available visual temporal querying tools do not provide the means for formulating complex temporal queries. For these queries users have to adopt text-based querying languages, such as SQL. The problem, however, is that using text-based languages is less comfortable than using visual tools and, most important, in some cases temporal queries can be extremely difficult to formulate for users that do not possess programming competences. In this paper we propose the Time Automaton, a highly flexible visual mechanism that enables the formulation of a large set of different types of temporal queries, ranging from the simple to the most complex ones. To prove its practical application we created a tool that implements the mechanism and used it to analyze a real dataset. Time Automaton was validated against a representative sample of temporal queries extracted from the matured OWL-Time Ontology. In order to understand if users, with or without programming competences, could understand and use the Time Automaton we conducted a usability experiment.