Map from Google - Xian

The climate of Xi'an is continental, with cold and dry winters, and hot and humid summers. The city is located in central China, at 400 metres (1,300 feet) above sea level, and at a latitude not very high, but it is almost a thousand kilometres (600 miles) away from the sea, and it is affected by the continentality of the Asian landmass. On the other hand, the position in a valley and the distance from the sea make the summer heat intense and annoying, while in winter, cold air often stagnates on the ground.
Here are the average temperatures.
Average temperatures - Xian
Min (°C)-304101520222116103-2
Max (°C)591422273132302619126
Min (°F)273239505968727061503728
Max (°F)414857728188908679665443

Capital of the province of Shaanxi (Shensi), Xi'an is also one of the ancient Chinese capitals, and has several interesting monuments, in addition to the famous Terracotta Army. Today it is a metropolis of millions of inhabitants, polluted as often happens in big Chinese cities.
Precipitation amounts to about 560 millimetres (22 inches) per year; due to the monsoon, the rainiest season is summer, while the driest is winter.
Here is the average precipitation.
Average precipitation - Xian
Prec. (mm)71025405565100809560207560
Prec. (in)0.30.411.

Winter, from December to February, is cold and dry: the average January temperature is 1 degrees Celsius (33.5 °F). Precipitation is rare and not abundant, but the sky is often cloudy. However, considering the low temperatures, there may be some snowfalls, generally light. The cold wind from the north can bring cold snaps, with minimum temperatures around -15 °C (5 °F), as well as the dust of the Gobi Desert. On the other hand, the south wind, which descends from the mountains, can bring mild days, with highs around 15/20 °C (59/68 °F).

In spring, from March to May, the temperature increases, while rainy days become gradually more frequent. The sunshine amount is just acceptable. In March and April, the clash between air masses can cause sand storms.

Summer, from June to August, is hot and muggy, and it is the rainiest season, as it's influenced by the Asian monsoon. June is already a hot month, but generally the rains and the muggy heat come in July, or during the month of June. However, the rains display an erratic pattern from year to year. The sunshine amount is fairly good, in fact summer is the sunniest season, although there are cloudy days even in this season. The rains occur mainly in the form of downpour or thunderstorm. During some years, the rains can be abundant also in September, and in some cases, but more rarely, in October as well. Periods of good weather during the summer can be very hot, with highs around 38 °C (100 °F), and in these cases the heat does not give relief even at night. August is usually a bit less hot than June and July, but it is more sultry.

Autumn, from September to November, is initially mild, and gradually becomes cooler, and then quite cold in November, but sometimes it can get cold at night already in October. Rainfall is initially quite frequent: September is even the wettest month of the year. As the weeks pass, rainfall gradually decreases, while the sky remains often cloudy.

Terracotta army

As mentioned, the amount of sunshine is never very good, although some sunny days can occur throughout the year.
Sunshine - Xian
Sun (hours)334556654333

When to go

The best times to visit Xi'an are spring and autumn, ie the months of April, May and October. In April and October it can sometimes be cold at night, with lows around freezing, while in May and September during the day it can be hot. In general, however, September is avoided because it is a rainy month, with the risk of flooding every so often. Sometimes the monsoon anticipates and already in May it can rain a lot, but usually in spring it rains less than in autumn. Autumn, in September and October, is similar to spring, but it is a cloudy season, and it's initially rainy.