Skip to content

Instantly share code, notes, and snippets.

View kmfolgar's full-sized avatar

Kevin MF kmfolgar

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmfolgar
kmfolgar / rest-time.do
Created April 5, 2017 18:35
How to substract two times in hours and minutes
g endtime=string(end_time)
replace endtime="0"+ endtime if length(endtime)==3
g endh=substr(endtime, 1,2)
g endm=substr(endtime, 3,4)
g starttime=string(start_time)
replace starttime="0"+ starttime if length(starttime)==3
g stah=substr(starttime, 1,2)
g stam=substr(starttime, 3,4)
destring endh endm stah stam, replace
@kmfolgar
kmfolgar / profile.do
Last active April 4, 2017 18:30
Do File for Automatic log with date in STATA's Profile
** Kevin Martinez-Folgar, MD.
** kmartinez@incap.int
log using log/`: display %tCDD-NN-CCYY ///
Clock(" `c(current_date)' `c(current_time)' ","DMYhms")', append ///
name("Log de Trabajo Diario")