Recently, Unmanned Aerial Vehicles (UAVs) are widely used for various purposes such as aerial reconnaissance and delivery in urban areas. However, in some urban areas there are geo-fences where aerial vehicles cannot pass through. So, the importance of a path planning including obstacle avoidance has increased. In addition to the actual observable obstacles, it is also necessary to plan the route considering special areas or boundaries such as geofence. In this paper, we propose an algorithm to avoid dynamically changing geo-fence. To generate an efficient path which does not pass through the geofence, we add a time parameter. This proposed path planning algorithm considers not only obstacles on the map at present. The goal is to create an efficient path that also takes into account the geo-fence information dynamically generated over time, along with the speed of the UAV and the time it takes to pass through a specific location. Simulations are carried out to verify the performance of the proposed path planning algorithm.