code: def timespan(t1, dt, keyword = 'days'):
      
      
      if keyword is 'days':
          dt *= 86400
      elif keyword is 'hours':
          dt *= 3600
      elif keyword is 'minutes':
          dt *= 60
      elif keyword is 'seconds':
          dt *= 1
      else:
          print("Invalid 'keyword' option.\nEnum(None, 'hours', 'minutes', 'seconds', 'days')")
          
      if not isinstance(t1, (int, float, complex)):
          t1 = tplot_utilities.str_to_int(t1)
      t2 = t1+dt
      xlim(t1, t2)
      
      return
docs: This function will set the time range for all time series plots.  This is a wrapper for the function "xlim" to
      better handle time axes.  
      
      Parameters:
          t1 : flt/str
              The time to start all time series plots.  Can be given in seconds since epoch, or as a string
              in the format "YYYY-MM-DD HH:MM:SS"
          dt : flt
              The time duration of the plots.  Default is number of days.  
          keyword : str
              Sets the units of the "dt" variable.  Days, hours, minutes, and seconds are all accepted.  
              
      Returns:
          None
      
      Examples:
          >>> # Set the timespan to be 2017-07-17 00:00:00 plus 1 day
          >>> import pytplot
          >>> pytplot.timespan(1500249600, 1)
          
          >>> # The same as above, but using different inputs
          >>> pytplot.timespan("2017-07-17 00:00:00", 24, keyword='hours')