This article needs additional citations for verification. (November 2016)
Mahlzeit is a German salutation. It is the short form of a more formal salutation, "Gesegnete Mahlzeit" (archaic term, de: Blessed mealtime). The salutation is commonly used without connection to food or eating in Northern Germany, and this usage, corresponding to something like "hello, everyone" or "I'm off, folks", is becoming more and more widespread in informal settings, such as between office co-workers. In Austria it is used as a salutation during meal times and can also be used before drinking Sturm (Federweisser) as reference to the meal-like quality of the fermenting grape juice. Similarly, in most German regions it is only used in connection with meals. However, soldiers typically greet each other with Mahlzeit (and the reply Mahlzeit, not danke) from getting up in the morning until about 8 pm, including the entire normal work day, presumably as the next mealtime is always within short distance and is looked forward to.
Mahlzeit can also be used in a negative sense. For example, when two people see something that might well spoil their appetite, one may sarcastically say "Mahlzeit" (or the stronger, "Na, Mahlzeit!") to the other.
When greeted with "Mahlzeit", one would ordinarily reply with "Mahlzeit" in return, or simply with "Danke", the German term for "thank you".