Did I find the right examples for you? yes no

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)
Parse a time value from a string, return a float in Unix epoch format.
If no time can be parsed from the string, return None.

        def parse_time(t):
  '''
  Parse a time value from a string, return a float in Unix epoch format.
  If no time can be parsed from the string, return None.
  '''
  try:
    return float(t)
  except ValueError:
    match = cal.parse(t)
    if match and match[1]:
      return time.mktime( match[0] )
  return None
        


src/t/o/torus-0.7.1/torus/web.py   torus(Download)
from gevent.pywsgi import WSGIServer
 
from .util import parse_time
from .exceptions import *
 
    end = params.get('end', [''])[0]
    if start:
      start = parse_time(start)
    if end:
      end = parse_time(end)
          interval = macro.get( 'interval', interval )
          if start:
            start = parse_time(start)
          if end:
            end = parse_time(end)

src/t/o/torus-HEAD/torus/web.py   torus(Download)
from gevent.pywsgi import WSGIServer
 
from .util import parse_time
from .exceptions import *
 
    end = params.get('end', [''])[0]
    if start:
      start = parse_time(start)
    if end:
      end = parse_time(end)
          interval = macro.get( 'interval', interval )
          if start:
            start = parse_time(start)
          if end:
            end = parse_time(end)