We let
x be the time it took John to get to his uncle's
y be the time it took John to get back from his Uncle's
So,
x + y = 12
And making use of the given velocities
20x = 30y
x = 3/2 y
Substituting to the first equation
3/2 y + y = 12
y = 4.8 h
Substituting to either of the equations
x = 7.2 h