The best time to visit Dublin is late spring to early autumn (May to September), when the days are long — daylight can stretch past 10pm in midsummer — the weather is at its mildest and the city's parks and outdoor life are at their best. July and August are the warmest and busiest months with the highest prices; May, June and September offer a good balance of decent weather and thinner crowds. March brings the huge St Patrick's Festival around the 17th, which is a great experience but packs the city and pushes up prices. Winter (November to February) is cold, wet and dark but atmospheric and cheapest, with a lively Christmas season. Whatever the month, Dublin weather is changeable and rain is possible any day, so always pack layers and a waterproof.
Dublin is generally safe but pickpocketing and bag-snatching are the main risks for tourists, concentrated in the busiest areas — Temple Bar, Grafton and O'Connell Streets, and on public transport. Keep your bag zipped and in front of you, keep your phone and wallet in inside pockets, and be extra alert in crowds and around clipboard or petition groups.
As in any capital, take normal care late at night. Anti-social behaviour and the odd altercation can occur around nightlife areas of the city centre and along the boardwalk of the Liffey after dark. Stick to busy, well-lit streets, keep an eye on your drink, and use a licensed taxi or a booked app to get home rather than an unlicensed tout.
Dublin's weather is mild but famously changeable — you can get sun, wind and rain in a single afternoon. It is rarely dangerous, but come prepared with layers and a waterproof jacket so a sudden shower doesn't cut your day short, and take care on wet cobblestones in Temple Bar and the older streets.