Difference between 時に、時は、時には


I am having a hard time figuring these out, it turns out that I get corrected
by native speakers a lot, when I use one of them, they will correct me saying
that another particle should be used instead.

> 大学に行く時に、もう夜なんだよ。
>
> 大学に行く時は、もう夜なんだよ。
>
> 大学に行く時には、もう夜なんだよ

At this point I am completly at lost in how different these should be, one
guess would be that に should be when I wanna talk what happens in that
"moment" and は when I wanna talk about that "moment" directly.

If my example is bad, please use a better one for exaplining the matter.

ps: The only related answer I found was this [What is the difference between
時に and 時は](https://japanese.stackexchange.com/questions/29687/what-is-the-
difference-between-%e6%99%82%e3%81%ab-and-%e6%99%82%e3%81%af?s=2|1.9694) but
it didn't clear out much for me, honestly.




I'll show you the difference by some examples like:

>   1. 大学に行く時 **に** 、雨が降る。
>   2. 大学に行く時 **は** 、雨が降る。しかし、大学に行かない時は、雨が降らない。
>   3. （今は雨が降っていないが、）大学に行く時 **には** 、雨が降るでしょう。  
>  ３'.（今は雨が降っていないが、）大学に行く時 **には** 、雨が降るので、傘を持っていかなければならない。
>

The sentence example 1 is a normal expression, which means _when I go to
college, it rains_.

**は** in the example 2 is a topic marker, and **大学に行く時** in the former
sentence is contrasted, in this example, to **大学に行かない時** in the following
sentence by the use of **は** instead of **に**. The whole meaning of the
example 2 would be " _In contrast to the other case, it rains when I go to
college. But, it would not rain when I don't go there_ ".

**には** in the example 3 is used to give the sentence a certain condition or
situation; in this sentence the condition is the time when I depart to
college. The meaning of the sentence example is that " _As for the time, it
will rain when I go to college, (though it's not raining now)._




大学に行く時に もう夜なんだ is "it's when we go to our college that it has already been
evening". It's because this sentence lacks topic parts, but nevertheless is an
independent sentence (without hidden informations) of statement that expresses
your assumption. So, it has to be interpreted as the so-called exhaustive
listing が usage.

大学に行くときは and 大学に行くときには can be used similarly but usually, the former is more
likely a plain main topic, as _someone_ says, while the latter には version
tends to convey a sense of concession, that is, "it will have already been
evening when we go to our college, no matter how late".

