Here is the way to remove time/timestamp from date in salesforce,
Way 1:
Note: The above format() method returns the Date as a string using the locale of the context user.
Reference: Date Class
Way 2:
Note: You can adjust the format based on your need.
Way 1:
- Date dt = System.Today();
- System.debug(dt.format());
Note: The above format() method returns the Date as a string using the locale of the context user.
Reference: Date Class
Way 2:
- Date dt = System.Today();
- System.debug(dt.day()+'/'+dt.month()+'/'+dt.year());
No comments:
Post a Comment