10-17-2015 05:38 PM
I have 2 TimeStamp fields . I would like to subtract one from another and have the difference in seconds.
Could someone tell me how can i do this ?
Note, sometime the difference between the timestamps can be more than one day.
10-17-2015 06:03 PM
What do you mean by timestamp field? If the value is a SAS date-time, then it is a numeric value which is the number of seconds since Jan 1, 1960. In that case you can just subtract timestamp2-timestamp1 to find the difference in seconds.
If the timestamps are stored in a character field, please show the format of the character string. It should be straight forward to convert them to SAS date-time, and then do the subtraction.