Fix code example
duration is seconds. fix end date