Changed cast of variable date from string to integer