@kankanzheli it’s the same as getting the image data.
Here you can find an example to create a subscriber:
http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber(python)#rospy_tutorials.2FTutorials.2FWritingPublisherSubscriber.Writing_the_Subscriber_Node
The timestamp is in the data.header.stamp
field.