As a footnote to this:
Katia's error message on trying to use a function -hms()- indicated to me that she was trying to use an -egen- function with -generate-.
She could have been trying to use a Stata 10 function -hms()- within an earlier version of Stata. (Else why did she get an error message?)
In Stata 10, users should note that the official function -hms()- differs from the user-written -egen- function -hms()-, and not just in so far as you can use the latter only with -egen-.
In Stata 10 you can do this, if you have installed -egenmore- from SSC:
. set obs 1
obs was 0, now 1
. gen seven = 7
. gen thirty = 30
. gen fifty = 50
. egen hms_egen = hms(seven thirty fifty)
. gen double hms_gen = hms(seven, thirty, fifty)
. l
+----------------------------------------------+
| seven thirty fifty hms_egen hms_gen |
|----------------------------------------------|
1. | 7 30 50 27050 27050000 |
+----------------------------------------------+
The result of -egen, hms()- is in seconds. The result of the function -hms()- is in milliseconds.