When talking about time or durations introduced by in - in two hours, in 1876,... - in French you will either use dans or en.
Here is how to know which one to use :
En une heure = (With)in an hour
En expresses the length of time something takes to be done.
Dans une heure = In an hour
Dans indicates the time until something will happen.
En 1998 / En octobre = In 1998 / In October
En is used with years and months.
You will never say : dans 1998 / dans octobre
See also how to pronounce years in French : Expressing dates in French