def get_current_date(time_zone='local', increment=0, result_format='timestamp', exclude_millis=False):
 if (time_zone.upper() == 'LOCAL'):
  dt = datetime.now()
 elif (time_zone.upper() == 'UTC'):
  dt = datetime.utcnow()
 else:
  raise ValueError(("Unsupported timezone '%s'." % time_zone))
 date = (Date(dt) + Time(increment))
 return date.convert(result_format, millis=is_falsy(exclude_millis))

def get_current_date ( time_zone = 'local' , increment = 0 , result_format = 'timestamp' , exclude_millis = False ) : if ( time_zone . upper ( ) == 'LOCAL' ) : dt = datetime . now ( ) elif ( time_zone . upper ( ) == 'UTC' ) : dt = datetime . utcnow ( ) else : raise ValueError ( ( "Unsupported timezone '%s'." % time_zone ) ) date = ( Date ( dt ) + Time ( increment ) ) return date . convert ( result_format , millis = is_falsy ( exclude_millis ) )
returns current local or utc time with an optional increment .