• spiker
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have the following piece of code in an apex class:

 

     // Convert the Date object to a DateTime object

DateTime checkDate = Datetime.newInstance(compDate.year(), compDate.month(), compDate.day(), 0,0,0);

// Assign the day (monday, tuesday, etc) to a string 

String dayOfWeek = checkDate.format('EEEE');

 

I am noticing that when I do a large number of calls to this, I am hitting the heap limit of 200,000.

 

All I am looking to do is check the day (monday, tuesday, etc) of a date.  But for some reason, I have to convert it to a DateTime to do this.  Is there a better way?

 

Thanks

 

--Todd Kruse