• Irina Aristova
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I have a legacy application, There are several test classes, that covered 1 class. How to find the overal code coverage for this 1 class? When I ran test classes separately they covered 15-20% each covering different lines of the class.
Irina AristovaFormat date function returns a wrong dateI converted Date time to string in Apex using format function:
DateTime yesterdayDate = Date.today().addDays(-1);
System.Debug(yesterdayDate);
String formattedDate = yesterdayDate.format('MM/dd/yyyy');
System.debug(formattedDate);

The result is:
USER_DEBUG|[24]|DEBUG|2015-05-05 00:00:00
USER_DEBUG|[27]|DEBUG|05/04/2015
I expected to be the same date: 05/05/2015, but it returned 05/04/2015 which is one day earlier
I need to convert date to a string but I am not able because it's returning the wrong date

The user object for me it's set up to:
Time Zone is (GMT-04:00) Eastern Daylight Time (America/New_York)
Locale: Enflish(United States)
Default Time Zone for company is the same as mine: (GMT-04:00) Eastern Daylight Time (America/New_York)
 
Irina AristovaFormat date function returns a wrong dateI converted Date time to string in Apex using format function:
DateTime yesterdayDate = Date.today().addDays(-1);
System.Debug(yesterdayDate);
String formattedDate = yesterdayDate.format('MM/dd/yyyy');
System.debug(formattedDate);

The result is:
USER_DEBUG|[24]|DEBUG|2015-05-05 00:00:00
USER_DEBUG|[27]|DEBUG|05/04/2015
I expected to be the same date: 05/05/2015, but it returned 05/04/2015 which is one day earlier
I need to convert date to a string but I am not able because it's returning the wrong date

The user object for me it's set up to:
Time Zone is (GMT-04:00) Eastern Daylight Time (America/New_York)
Locale: Enflish(United States)
Default Time Zone for company is the same as mine: (GMT-04:00) Eastern Daylight Time (America/New_York)
 
I have a legacy application, There are several test classes, that covered 1 class. How to find the overal code coverage for this 1 class? When I ran test classes separately they covered 15-20% each covering different lines of the class.
Irina AristovaFormat date function returns a wrong dateI converted Date time to string in Apex using format function:
DateTime yesterdayDate = Date.today().addDays(-1);
System.Debug(yesterdayDate);
String formattedDate = yesterdayDate.format('MM/dd/yyyy');
System.debug(formattedDate);

The result is:
USER_DEBUG|[24]|DEBUG|2015-05-05 00:00:00
USER_DEBUG|[27]|DEBUG|05/04/2015
I expected to be the same date: 05/05/2015, but it returned 05/04/2015 which is one day earlier
I need to convert date to a string but I am not able because it's returning the wrong date

The user object for me it's set up to:
Time Zone is (GMT-04:00) Eastern Daylight Time (America/New_York)
Locale: Enflish(United States)
Default Time Zone for company is the same as mine: (GMT-04:00) Eastern Daylight Time (America/New_York)