diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-02-03 13:30:47 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-02-03 13:30:47 +1300 |
commit | 6c89749f0a0c77e3a56a68df8709daf9c9f2f33c (patch) | |
tree | 2c12a17a18f5215124da887a3b0c465fd0c910b9 /libmproxy/utils.py | |
parent | 673ff01acc07c0aa04c5a37f745343cebc34c64b (diff) | |
download | mitmproxy-6c89749f0a0c77e3a56a68df8709daf9c9f2f33c.tar.gz mitmproxy-6c89749f0a0c77e3a56a68df8709daf9c9f2f33c.tar.bz2 mitmproxy-6c89749f0a0c77e3a56a68df8709daf9c9f2f33c.zip |
Add timestamps to flows.
For now, these are only displayed on the connection view screen, with second
granularity.
Diffstat (limited to 'libmproxy/utils.py')
-rw-r--r-- | libmproxy/utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libmproxy/utils.py b/libmproxy/utils.py index 7b9d0e32..ee0d9b43 100644 --- a/libmproxy/utils.py +++ b/libmproxy/utils.py @@ -13,9 +13,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import re, os, subprocess +import re, os, subprocess, datetime from contrib import BeautifulSoup + +def format_timestamp(s): + d = datetime.datetime.fromtimestamp(s) + return d.strftime("%Y-%m-%d %H:%M:%S") + + def isBin(s): """ Does this string have any non-ASCII characters? |