It’s been like this for ages… no you cannot purchase alcohol during those times.
“Daily Ban on Sale of Alcohol, Elections, and Religious Holidays
The sale of alcohol in Thailand is banned between 2pm and 5pm and again between midnight and 11am seven days a week. This rule largely affects supermarkets and chain shops, such as 7-11 or Tops. It is common knowledge that the law is not always enforced at smaller, family-run shops.
The Election Commission of Thailand also bans alcohol on Election Days for the offices of Prime Minister and Senator, including advanced voting days. In addition, the Government of Thailand has also been known to ban alcohol during religious holidays.”