Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65569

extracting the day of the week from a SIF in a dmy standard

$
0
0
Hi everyone I would like to extract the day of the week from a DMY form in stata. So below is the code is used to convert my time variable into a stata readable form.

gen double date2 = clock( MealEventtime , "#DMYhm")
gen double date3 = round(date2, 3e5)
format %tc date3
rename date3 eventtime

The dow function seems to produce all empty data points. I think this is because it wants it in a MDY not DMY.

Any ideas on how i can solve this?

Cheers,
Daniel

Viewing all articles
Browse latest Browse all 65569

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>