In a pervasive sensor system, application entities may use the available infrastructure resources such as sensing devices, actuators, wireless modules and gateways to accomplish various tasks. For example, a group of humans/robots may use the infrastructure to track the current location of the group members. Many such tasks require a service which keeps track of the order of occurrence of events in the application. Existing algorithms for this problem have been designed for traditional distributed systems using the layering paradigm where the algorithm is able to observe and intercept application messages. Pervasive applications, however, may not be structured as strictly layered systems. In this paper, we study the problem of event ordering in pervasive systems, and propose algorithms for (Ictecting event ordering. Our first algorithm treats the entire network as a single graph, whereas the second algorithm operates in a hierarchical manner by subdividing the network into smaller groups. We present experimental evaluation of our algorithms using both simulation and deployment oil a sensor testbed.