$yesterday = date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y")))
UPD: (thanks to stamm)
$yesterday = date('Y-m-d', strtotime('- 1 day'));
$yesterday = date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y")))
$yesterday = date('Y-m-d', strtotime('- 1 day'));
import sys print "Version: %d.%d.%d\n" % sys.version_info[:3] string_params = {'a':1, 'b': 2} unicode_params = {u'a':1, u'b': 2} def f(a,b): print "params: ", a, b print "Run with string params:" f(**string_params) print "\nRun with unicode params:" f(**unicode_params)
Version: 2.5.1 Run with string params: params: 1 2 Run with unicode params: Traceback (most recent call last): Line 15, inf(**unicode_params) TypeError: f() keywords must be strings
network.http.use-cache
browser.cache.offline.enable
browser.cache.disk.enable
browser.cache.disk_cache_ssl
browser.cache.memory.enable
>>> import cgi >>> >>> test_string = "This is <unsafe> string & it contains wrong symbols" >>> >>> print cgi.escape(test_string) This is <unsafe> string & it contains wrong symbols
sudo pip install werkzeugI made a runner script run.py that makes a dev server with Werkzeug and voila:
from werkzeug.serving import run_simple from wsgi import application run_simple('127.0.0.1', 4000, application)