I have a dataset of GPS with timestamp variable.
I would like to extract observations that do not have timestamps between 0am and 5am in stata.
i tried the following command but it didnt work.
drop if ! (hours(my_timestamp_variable)>=0 & hour(my_timestamp_variable)<5
I also tried the command below, but didnt work as well.
drop if ! my_timestamp_variable>=tc("09oct2013 00:00:00") & my_timestamp_variable<tc("09oct2013 05:00:00")
my_timestamp_variable is like as below after conversion using the following commands.
my_timestamp_variable: "09oct2013 00:00:00"
command: format v6 %tc
Thank you very much for your help in advance.
Best regards,
I would like to extract observations that do not have timestamps between 0am and 5am in stata.
i tried the following command but it didnt work.
drop if ! (hours(my_timestamp_variable)>=0 & hour(my_timestamp_variable)<5
I also tried the command below, but didnt work as well.
drop if ! my_timestamp_variable>=tc("09oct2013 00:00:00") & my_timestamp_variable<tc("09oct2013 05:00:00")
my_timestamp_variable is like as below after conversion using the following commands.
my_timestamp_variable: "09oct2013 00:00:00"
command: format v6 %tc
Thank you very much for your help in advance.
Best regards,
Comment