code: def dateToInt(date, strfmt="%Y%m%d"):
      """Converts a datetime date into int
      Parameters:
      -----------
              date : datetime
                      date in datetime format
              strfmt : string
                      format in which the int date will be generated
      Example:
              dateToInt(dt.date(2015,10,23),'%Y')
      """
      return int(date.strftime(strfmt))
  
imports: import datetime
label_desc: Use image node_id 5 for calling a global function with example usage: dateToInt(date, strfmt) and returns: int