Hello friends today we will discuss about Data and Date Time format into Salesforce with some sample code
Hello friends today we will discuss about Data and Date Time format into Salesforce with some sample code
| DateTime dt = DateTime.now(); | |
| String dateTimeStr = dt.format('yyyy/MM/dd hh:mm:ss'); | |
| System.debug('>>>>' + dateTimeStr); |
| TEXT(MONTH(DATEVALUE(NOW())))+"/" +TEXT(DAY(DATEVALUE(NOW())))+"/" +TEXT(YEAR(DATEVALUE(NOW()))) & " " & | |
| MID(TEXT(NOW()-TZoffset), 12, 2) & ":" & | |
| MID(TEXT(NOW()-TZoffset), 15, 2) & ":" & | |
| MID(TEXT(NOW()-TZoffset ), 18, 2) |
No comments:
Post a Comment