1 Reply Latest reply: Mar 27, 2012 8:13 AM by Stefan Wühl RSS

    Generate month and year from date or timestamp

      Hello Community,

       

      i want to generate date and month together from a timestamp. When I use the month-function it's only the month seperated from the year. The year-function is almost the same. Is there any way or function i can select month and year together? Thank you in advance

        • Generate month and year from date or timestamp
          Stefan Wühl

          Maybe you are looking for function Monthname() ?

           

          MonthName(date [, shift = 0])

          Returns a display value showing the month (formatted according to the MonthNames script variable) and year with an underlying numeric value corresponding to a timestamp with the first millisecond of the first date of the month. Shift is an integer, where the value 0 indicates the month which contains date. Negative values in shift indicate preceding months and positive values indicate succeeding months.

          Examples:

          monthname ( '2001-10-19' ) returns 'Oct 2001' with an underlying numeric value corresponding to '2001-10-01 00:00:00.000'

          monthname ( '2001-10-19', -1 ) returns 'Sep 2001' with an underlying numeric value corresponding to '2001-09-01 00:00:00.000'