Linked Questions

0
votes
1answer
2k views

How to get day from Datetime field [duplicate]

I want to extract my datetime value into different. I want to get day from the datetime value. eg: if datetime value is 2012/02/03 10:12:02 Tue. I want Tue from datetime. Is this possible.
0
votes
1answer
314 views

Need to know which day-of-week is represented by the DateTime object [duplicate]

I'm using the DateTime object in my apex code. In the documentation of the DateTime class I saw there are methods to return day-of-month, day-of-year but there is no method to return day-of-week what ...
22
votes
4answers
15k views

Days between two DateTime values excluding weekends

In Apex, how can you calculate the number of days between two dates excluding any days that fall on the weekend? This would be similar to the existing Date.daysBetween() method. There is a similar ...
13
votes
1answer
1k views

DateTime.day() returning inconsistent value when created from system.today()

This came up on twitter from @britishboyindc: Why does this return 'Wed'? Date myDt = system.today(); DateTime myDtTime = (DateTime) myDt; system.debug(myDtTime.format('E')); For a user with the ...
2
votes
2answers
5k views

Formula to get the start date of the week

Is there a way we can use a function like .tostartofweek() in formulas. In short if the user enters date as 02/26/2013 i want the formula to get the entry_date.tostartofweek() in formula field Any ...
0
votes
4answers
1k views

Apex: How to generate List of all Friday Dates for given month

I am trying to create a List of date type which contains every Friday of the month in it. So for example, for the month of March, the list would contain the dates of March 3rd, 10th, 17th, 24th and ...
1
vote
1answer
1k views

Hide column in pageBlockTable based on day

I have a pageBlockTable whose column headers are dynamically generated based on the date. I would like to hide any column whose date falls on a Sunday. Below is the sample of the code for one of the ...
0
votes
2answers
570 views

How can I get Last weeks date range in Visualforce component

I need to populate Last week, Last two weeks, current Month dates in Visualforce Component, how can I do that. <apex:outputText value="{0, date, MMMM d',' yyyy}"> <apex:param value="{!...
0
votes
2answers
136 views

DateTime Calculate in apex class [closed]

how to display the following values from the two given date. "IN" If does not contatain the Sunday or saturday. "OUT" If Sunday or monday appear in the two give date. Example: indate : ...
-1
votes
1answer
78 views

Salesforce Date field (add a month/31 days but cannot end on weekend)

I have two fields in a particular opportunity. One is the "Proposal Sent Date" which is automatically entered when the user generates the proposal (via Conga Composer). I also have the "Proposal Valid ...