aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/utils.py')
-rw-r--r--libmproxy/utils.py8
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?