Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: calculating time difference

From   Shehzad Ali <>
To   Stata List <>
Subject   st: calculating time difference
Date   Fri, 24 Aug 2012 15:50:16 +0100 (BST)

Hi listers,

I want to calculate the duration between two time points (-time1- and -time2-). The time variables are in string format and the variables appear in the format of HH:MM. I tried the following but it doesn't help:

gen double clock1 = clock(time1,"hm")

When time1 is 10:20, the new var -clock1- is 37200000.

Any help would be appreciated.

Thank you

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index