title: Localized month names in Firebird
body: <p>I need to get various parts of a TIMESTAMP field - specifically <em>year</em>, <em>localized month name</em> (in Russian), <em>day of month</em> and <em>hours interval</em> (like '11 - 12'). </p>
  
  <p>Currently i came up with this:</p>
  
  
  
  <pre class="lang-sql prettyprint-override"><code>select
  extract (year from prt.dtbegin) as f_year,
  (
    case extract (month from prt.dtbegin)
      when 1 then 'Январь'
      when 2 then 'Февраль'
      /* ... */
      when 12 then 'Декабрь'
    end
  ) as f_month,
  cast (lpad (extract (day from prt.dtbegin), 2, 0) as char(2)) as f_day,
  (
    cast (lpad (extract (hour from prt.dtbegin), 2, 0) as char(2)) 
    || ' - '
    || cast (lpad (extract (hour from prt.dtbegin) + 1, 2, 0) as char(2)) 
  ) as f_hour
  from prt
  </code></pre>
  
  <p>It works fine (interval '23 - 24' is OK at the moment), but I don't like it, especially CASE sentence with each and every month.</p>
  
  <p>So, i'd like to know, is there any common way of getting localized month names in Firebird? Also, can i format extracted parts of timestamp, instead of current cast-lpad-extract construct?</p>
  
  <p>Thanks in advance.</p>