You can use time.parseUTC() to convert dates from day, month and year. If you subtract one date from another, you get an internal time delta value. You can add or subtract a delta from a date, but you can't extract data about how many days it represents from it directly. Instead, to convert to a number of days, you can convert it to the numeric "ticks" format with time.toTicks(). That will return an extremely large number, because there are 10 million ticks per second. You can divide that number by (10000000 * 60 * 60 * 24) to get the number of days.