Praise be to Allah.
It seems that you are asking about breaking your fast during the day in Ramadaan, but it also seems from your question that the distance between your city and the city to which you travelled is far, because the journey took you a number of hours. Such a distance is regarded as a journey and it is permissible for the traveller (musaafir) to break his fast in Ramadaan. But you have to make up that day, because Allaah says (interpretation of the meaning):
“and whoever is ill or on a journey, the same number [of days which one did not observe Sawm (fasts) must be made up] from other days”
And Allaah knows best.