Day

  • Day of Month => `system.now().format('d')`
  • Day of Year => `system.now().format('D')`
  • Day of Week => `system.now().format('F')`
  • Day in Year => `system.now().format('D')`
  • Day as Week i.e., **XXX** => `system.now().format('e')`
  • Day as Week ilme., Sunday, Monday => `system.now().format('EEEE')`
  • Day of Week in Month => `system.now().format('F')`
  • NOTE: Please find difference between 'w' & 'W' above

    Week

  • **Current Week #** in **Current Year** `system.now().format('w')`
  • **Current Week #** in **current Month** `system.now().format('W')`
  • NOTE: Please find difference between 'w' & 'W' above

    Month

  • To get **Current Month** as Integer `system.now().format('M')`
  • To get **Current Month** as semi string i.e, **Jan, Feb, Mar** and so on `system.now().format('MMM')` `system.now().format('MMM')`
  • To get **Current Month** as full string i.e., **January, February** and so on `system.now().format('MMMM')`
  • Year

  • Current Year as **XXXX** => `system.now().format('Y')`
  • Current Year as **XX** => `system.now().format('YY')`
  • NOTE: Format methods returns as String, from string convert into respective dataType

    Time

  • **AM/PM** => `system.now().format('a')`
  • **Hour** in Day **(00-23)** => `system.now().format('a')`
  • **Hour** in Day **(01-24)** => `system.now().format('k')`
  • **Hour** in AM/PM **(00-11)** => `system.now().format('a')`
  • **Hour** in AM/PM **(01-12)** => `system.now().format('a')`
  • **Minute** in **Hour** => `system.now().format('m')`
  • **Second** in **Minute** => `system.now().format('s')`
  • **MilliSecond** in **Minute** => `system.now().format('S')`
  • **Time Zone** => `system.now().format('z')`
  • Display Date in Different Types as follows,