Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
What is the precise function of 了 in the sentence
我在这里两个星期了 / "I've been here for two weeks"
Is it a marker of completed action? Is it saying "already"? What does the sentence mean if 了 were omitted?
了 here denotes a completion. It could be rendered with the perfect tense in English. Staying here for two weeks is completed, namely I have been here for two weeks(already).
I think this 了 is just for emphasis, or to show you are done speaking.
Required, but never shown