In Japanese, what does the word "kimashita" mean and how does it work?


In my text book it says “`kimashita`” is the past form of “to come”.

But then in the textbook it says:

[code]

    How long have you worked here?
    Koko de wa dorekurai hataraite kimashita ka?
    
[/code]

How does “`kimashita`” mean “`come`” in this context?

In this
[question/answer](https://japanese.stackexchange.com/questions/676/difference-
between-%E3%81%A6%E3%81%84%E3%81%8F-and-%E3%81%A6%E3%81%8F%E3%82%8B) it says
that `-ていく (te iku)` and `-てくる (te kuru)` mean a change in state. That would
explain the use of **te** in hatarai **te** , but I am not sure how the
information in that question/answer relates to the use of `kimashita` in the
example phrase (in the textbook kimashita is described as meaning the past
form of `to come`. What does `came` having to do with `working`?)




In Japanese, there is something called _a subsidiary verb_. Read this first:
[What is a subsidiary verb?](https://japanese.stackexchange.com/q/18952/5010)

A subsidiary verb is similar to English `have to` as in "I have to swim" and
`be going to` as in "I'm going to swim". See how these `have` and `go` have
lost their original meanings.

来る (kuru) on its own means "to come", but as a subsidiary verb (i.e., after
the te-form of another verb), it means something different. As a subsidiary
verb, くる (kuru) is usually written with hiragana, and it typically describes:

  * an action/state which has been kept/continued/repeated until now
  * a gradual state change over time up until now
  * a physical movement toward the speaker

くる in 働いてくる (hataraite kuru) is used in the first sense above. In this case,
you can translate it either simply as "have worked", or explicitly as "have
kept working".

Another example:

> 試験に向けて、まじめに英語を勉強して **きた** 。  
>  Shiken ni mukete, majime ni eigo o benkyo shite **kita**.  
>  Toward the examination, I have kept studying English seriously.

Kimashita is the past tense of kimasu, which is the polite (a.k.a. masu) form
of kuru.




In Japanese, there is something called _a subsidiary verb_. Read this first:
[What is a subsidiary verb?](https://japanese.stackexchange.com/q/18952/5010)

A subsidiary verb is similar to English `have to` as in "I have to swim" and
`be going to` as in "I'm going to swim". See how these `have` and `go` have
lost their original meanings.

来る (kuru) on its own means "to come", but as a subsidiary verb (i.e., after
the te-form of another verb), it means something different. As a subsidiary
verb, くる (kuru) is usually written with hiragana, and it typically describes:

  * an action/state which has been kept/continued/repeated until now
  * a gradual state change over time up until now
  * a physical movement toward the speaker

くる in 働いてくる (hataraite kuru) is used in the first sense above. In this case,
you can translate it either simply as "have worked", or explicitly as "have
kept working".

Another example:

> 試験に向けて、まじめに英語を勉強して **きた** 。  
>  Shiken ni mukete, majime ni eigo o benkyo shite **kita**.  
>  Toward the examination, I have kept studying English seriously.

Kimashita is the past tense of kimasu, which is the polite (a.k.a. masu) form
of kuru.

