title: Thai year 2558 to 2015
body: <p>How to transform buddhist format of datetime into gregorian format (e.g. for Thailand 2558 → 2015)?</p>
  
  <pre><code>using System.Text;
  using System.Threading;
  using System.Threading.Tasks;
  
  namespace ThailandBuddhistCalendarTest
  {
      class Program
      {
          private const string DateFormat = "yyyy-MM-dd";
          private const string DateTimeOffsetFormat = "yyyy-MM-dd'T'HH:mm:sszzz";
  
          static void Main(string[] args)
          {
              var ci = new CultureInfo("th-TH");
              var today = DateTime.Now.ToString(DateFormat, ci); // today == "2558-05-22"
          }
      }
  }
  </code></pre>