Play with Week, Month, Current/Fiscal Year #'s with Apex Salesforce
NOTE: Please find difference between 'w' & 'W' below
Week
NOTE: Please find difference between 'w' & 'W' above
Month
Year
NOTE: Format methods returns as String, from string convert into respective dataType
Time
Display Date in Different Types as follows,
Use Case | Syntax | Output |
---|---|---|
Day in Week | system.now().format('F') | Integer |
Day in Month | system.now().format('d') | Integer |
Day in Year | system.now().format('D') | Integer |
Day as Week | system.now().format('E') | SUN, MON, TUE |
Day as Week | system.now().format('EEEE') | SUNDAY, MONDAY, TUESDAY |
Note For all above methods
GMT
timezone is default. In order to get results as per your Timezone passTIMEZONE
as extra parameter.
For e.g., IST, PST, EDT etc.. so methods looks like system.now().format('d', 'IST')
Use Case | Syntax | Output |
---|
Use Case | Syntax | Output |
---|
Use Case | Syntax | Output |
---|