Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Difference between times


From   Nikolaos Kanellopoulos <nkkanel@yahoo.gr>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Difference between times
Date   Sat, 12 Sep 2009 01:57:10 -0700 (PDT)

Maarten,

Thanks very much. This was exactly what I wanted.

Nikos



----- Original Message ----
From: Maarten buis <maartenbuis@yahoo.co.uk>
To: statalist@hsphsun2.harvard.edu
Sent: Saturday, September 12, 2009 1:52:16 AM
Subject: Re: st: Difference between times

--- On Fri, 11/9/09, Nikolaos Kanellopoulos wrote:
> However, can the final result appear in the format of
> HH:MM:SS? In your example something like 00:00:45?

*--------- begin example -----------------------
clear
input t
3600
5400
10800
1810
end

gen h = string(floor(t/3600))
gen m = string(floor(mod(t,3600)/60))
gen s = string(mod(t,60))
gen diff_reformatted = h + ":" + m + ":" + s
list
*------------------ end example -----------------

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------





      

*
*   For searches and help try:
*  http://www.stata.com/help.cgi?search
*  http://www.stata.com/support/statalist/faq
*  http://www.ats..ucla.edu/stat/stata/



      
___________________________________________________________ 
Χρησιμοποιείτε Yahoo!; 
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail 
διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών 
μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr 



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index