I assume that you are asking about the weekly closing of the retail spot forex market -- the market which exists between retail forex traders (like us) and our brokers.
The Friday closing time varies from one retail broker to the next. In the U.S., the two largest retail brokers use different closing times. Forex.com (the largest broker) closes their platform (which, in turn closes all trading) at 7 pm New York time. Oanda (the second-largest U.S. retail broker) closes down at 5 pm New York time.
5 pm New York time is a popular time for the opening and closing of daily candles, because it coincides with the daily lull in the worldwide currency market which typically occurs between 5 pm and 6 pm. Accordingly, many brokers align their daily candles, their Monday opening, and their Friday closing to this time.
One pattern, followed by many brokers worldwide, is to open their Monday daily candles at 5 pm New York time on Sunday, closing them at 5 pm New York time on Monday; then opening their Tuesday daily candles at 5 pm New York time on Monday, and closing them at 5 pm New York time on Tuesday; and so forth throughout the week until 5 pm New York time on Friday when their Friday daily candles are closed.
This pattern provides for 5 equal-length trading days of 24 hours each, as opposed to the shortened Sunday and Friday trading days that some other brokers adhere to.
Notice two things:
(1) Brokers all over the world can conform to the 5 pm New York open/close time, by translating that time into their own time zones. So, for brokers in the U.K. who follow this pattern, the open/close time is 10 pm London time. For brokers in Europe, it would be 11 pm Frankfurt time. And so forth.
5 pm NY time = 10 pm London time = 11 pm Frankfurt time = 2200 GMT in the winter (std. time).
5 pm NY time = 10 pm London time = 11 pm Frankfurt time = 2100 GMT in the summer (DST).
(2) The open/close time of daily candles determines the open/close times of all the smaller time-frames down to 2-hour. That is, if a broker opens daily candles at 5 pm New York time, then 2-hour candles will open at 5 pm, 7 pm, 9 pm, etc., throughout the trading day; 3-hour candles will open at 5 pm, 8 pm, 11 pm, etc.; 4-hour candles will open at 5 pm, 9 pm, 1 am, etc. And so forth. One-hour candles, and all time-frames lower than 1-hour are not affected by the open/close time of daily candles. Nor are weekly and monthly candles affected.
Back to your question about a midnight closing time: which broker are you referring to?
In the second paragraph of this post, there is an error regarding the closing time of daily candles on the FOREX.com platform. See post #3 below for the correct info.