Questions tagged [date]

A value that indicates a particular day. Unlike Datetime values, Date values contain no information about time

Filter by
Sorted by
Tagged with
1
vote
1answer
28 views

Assigning operators for Date fields and comparing with today(), Scheduled Apex Code

Exam_Date__c = 01/01/2018, Expiration_Date__c = 01/31/2018 (usually 30 days gap) I want to send an email 7 days prior to expiration, on say eg. 01/25/2018, likewise. I used the following formula in ...
0
votes
1answer
32 views

Business day formula help

The use case: I am trying to calculate a date that is 3 "Bank Business days" after the application create date. Which includes Saturday and not Sunday. The Below Formula is taking into consideration ...
1
vote
2answers
805 views

Lightning Component - Date formatting not consistent with standard UI

I am using lightning:datatable to render data including dates. My date column definition looks like: { label: 'Expiration', fieldName: 'ExpirationDate__c', type: 'date'} The date in the table is ...
0
votes
2answers
539 views

How to pass Date dynamically to newInstance method of Datetime

i want to pass date into newInstance method of datetime class then i will get date of week.when i have given static date it's working fine but when i try to pass dynamically i am getting error please ...
0
votes
1answer
43 views

Anyone know how to remove/hide the [ 00/00/0000] Date from the date input field?

I'm just wanting to hide/remove todays date at it serves no purpose in my form any idea how I do this?
0
votes
1answer
130 views

DLRS - SOQL Error and returning text

I am trying to create a rollup field using the DLRS tool. However, I am running into multiple problems. Ideally, I would like to have my field find the most recent activity date and return the ...
1
vote
2answers
33 views

Looping through all entries using a Primary_key, Validating and Updating the corresponding field Values

Exam is an object. It contains the following fields - exam_name(String), exam_state(picklist), exam_date(date), expiration_date(date) 'exam_name' is an AutoNumber(string) field (starts from 1 and ...
0
votes
3answers
3k views

How to remove time from date?

The following code returns the time of the current date: System.debug('Current date: ' + Date.today().toStartOfMonth()); Output: 2018-08-01 00:00:00 How to remove time from date?
0
votes
4answers
760 views

Merge Date & Time field in to datetime field using formula field

We have to separate fields to pick appointment date & appointment time in Custom object. Now we have to filter out appointments between two dates (w/ time), so I need to compare appointment date &...
1
vote
1answer
55 views

BusinessHours and scheduled dates

I am trying to create a payment schedule off of a input field DATE. If the date falls on a Weekend or on a Holiday then I want to move the payment date to the next open business day. I was using the ...
3
votes
1answer
88 views

Why Datetime and Date class don't have more parse options for various Datetime/Date string formats

From documentation: Date Class: parse(stringDate) Constructs a Date from a String. The format of the String depends on the local date format. Datetime Class parse(datetimeString) ...
2
votes
1answer
1k views

How to properly handle dates returned from REST API

So it appears that when returning a DATE field from the REST API, that salesforce does NOT convert it to UTC (Doesn't return any time-zone information, just a YYYY-MM-DD string. Instead it returns ...
0
votes
3answers
77 views

How do I set a project end date to be 6 months out from the start date?

I created a custom field called Start_Date of type date. I created another field called End_Date that I would like to default to Start_Date + 6 months. But whenever I try to do this in a formula I get ...
2
votes
2answers
686 views

how to get the date and time format that you want in apex?

I have these lines of codes in my test class: Test.startTest(); String sch = '0 0 23 * * ?'; String jobId = System.schedule('Delete Batch Donation Logs', sch, batchDeleteLogs)...
2
votes
1answer
243 views

Date.ValueOf(TimeStamp) Changes TIme of Original DateTime Field. I'm Confused Why?

I've noted very strange behaviour in some Apex code I'm running. If I use the Date.ValueOf() function on a datetime. If I then print out the DateTime afterwards the hour/minutes of it have changed to ...
2
votes
1answer
116 views

DateTime Vs. Date Flow To ProcessPlugin

I find this to be odd, not sure if this is a known issue or if it is something I just have to convert but I have a flow that calls a apex process plugin class. The flow takes a variable of type Date ...
1
vote
1answer
327 views

Determine if today is between 2 dates AMPScript

I am trying to set a flag based on today being between 2 hard set dates. EX: SET @today = Format(Now(), "MMMM d, yyyy") SET @startDate = Format("2018-07-18","MMMM d, yyyy") SET @endDate = Format("...
3
votes
0answers
198 views

Moment JS but for Salesforce Apex

Are there any open source libraries similar to Moment JS but for Apex? Reference: Moment JS
0
votes
1answer
152 views

Is there a limitation of date value while parsing in apex

There seems to be some parsing limitation on string dates in apex. When I am doing the following it throws a system exception saying invalid date: String s = '12/31/5000'; Date.parse(s); However ...
0
votes
1answer
488 views

Check if date is in This Week

I want to check if today is with in This Week in Salesforce formula. I tried to do this via Date() function, but there is no THIS WEEK function. If there a workaround? I don’t have a solid code, so ...
1
vote
1answer
68 views

Best way to standarize datetime formats in Lightning framework based app

I want to standarize datetime formats in my lightning app. My requirement is datetime display format based on Salesforce user locale settings. One possible approach that is based on static locale -> ...
0
votes
1answer
297 views

How to filter a objectlist in javascript by date

I have lightning controller in were I want to filter a list based on a datefield. I tried the following but end up with an empty list: My list has 2 records: serverList[0].Startdatum__c = 1-12-2018 ...
2
votes
1answer
144 views

Why do I get a Parse error on date field

I have the following simple query but i am getting a parsing query error, any ideas? SELECT startDate__c FROM invoice__c WHERE startDate__c.month() = 3 startDate__c is a date field. No errors if i ...
6
votes
3answers
12k views

Lightning:input type=“date”: how to change the date fomat - Summer'18

I'm trying to change date format of this component but I dont find any attribute (like ui:inputDate has) to change the date format. <lightning:input type="date" name="input8" label="Dates" value="...
0
votes
1answer
498 views

<apex:input type=“date” /> Not displaying date picker in Internet Explorer

<apex:input type="date" styleClass="input-text-center" value="{! data.offerDate }" rendered="{! IF( AND( data.isField = true, data.isDateField = true ) , ...
1
vote
1answer
30 views

Comparing Dates - Date.ValueOf() seems to not output correctly - returns 01:00:00

Maybe I'm misunderstanding Date.ValueOf() - but I'm not expecting this behavior... I'm was thinking the dates would be the same. List<Limits__c> mostRecentBatch= [select id, lastModifiedDate ...
0
votes
2answers
615 views

Difference between two dates and add business days?

I have two dates, Created date and date processed. I want to find the midway between these two days but make sure the midway date lands on a business day. DATEVALUE(createdDate) + (( ...
1
vote
2answers
288 views

Convert String into formated date

I have a string like this : 10/12/1990 that is supposed to be a date. I need to convert it into a date like that : 1990-12-10 How can I do that ? I tried a lot of things like converting it ...
0
votes
1answer
21 views

identify the last 2 weeks of the last quarter month

I do not want the user to save the CloseDate as the last 2 weeks of the last quarter month. for ex. March 16-31 / June 16-30 / Sept 16-30 / Dec 16-31 Currently I am trying to use a validation rule ...
-1
votes
1answer
55 views

Validation rule getting quarterly months

I am trying to get only the months March,June,September,December. Not sure why this isn't working, I use Ceiling which gives the rounded estimate. OR( CloseDate = DATE(YEAR(TODAY()), CEILING(MONTH(...
0
votes
1answer
18 views

Validation rule Not working properly

My validation rule, I am playing around. Should activate only when June 15/2018 or June 16 2018. But it activates for any date. Not sure why. OR(ISPICKVAL( StageName , "1 - Prospect"), ISPICKVAL( ...
0
votes
0answers
26 views

Dynamic Word in SMS [duplicate]

I will need to send a SMS for the first time and I will need to have on it one dynamic word, a date. I'm using AMPScript to do that but all my tentatives fail. e.g See more information on %%[ SET @...
2
votes
1answer
906 views

Calculate business days between two dates

I'm trying to create a formula that would calculate the business days between "Claim Filled/Submitted Date" and "Date/Time Closed" for claims turn time. I'm using the formula:  (5 * ( FLOOR( ( date_1 ...
0
votes
2answers
527 views

Is there a way in process builder to check if a date is set and if so, if it is greater than something?

I am trying to implement some form of attribution, where there are two cases: Date has not been set (i.e. this is the first opportunity) Date has been set (i.e. this is not the first opportunity) ...
0
votes
1answer
84 views

Get previous month date to string no day

New to salesforce and apex, was wondering if there was a good way to get a date in this format: "201804" would be what the function would return currently. Essentially the date last month without ...
1
vote
1answer
370 views

Null check for Date field on VF Page

How do I check if a Date field is null? Below is the code: <apex:outputText label="Date:" value="{0, date, MM/ dd/ yyyy}" style="text-align:center;" > <apex:param value="{!care....
0
votes
2answers
469 views

Remove time stamp from the date

I want assign a date value into a WHERE clause of query This is my date Date myDate = System.Today().AddDays(Integer.valueOf(Deal_Expiration_Batch_Settings__c.getInstance()....
0
votes
0answers
23 views

Order by if data is same for a field

In visualforce page which use apex:repeat, and also for client side sorting uses datatable.js. A field column with date type is shown. Also the page allows inline editing, on successful edit it will ...
3
votes
1answer
485 views

Invalid Date Format for CloseDate with simple salesforce

I'm encountering some issues when attempting to create an opportunity using the python library simple salesforce. I've verified that CloseDate is a Date Type field. With the simple salesforce ...
0
votes
1answer
98 views

Formula - Multiply Date Field by Picklist value (Number of Weeks) - Needs to be editable

Trying to create in Process Builder. When a Lead Time is selected from a picklist then The Contract_Date__c is populated with Order Received Date * Lead Time So if you have a Contract Date of today ...
0
votes
1answer
178 views

Date parsing issue - Invalid date

The visualforce page uses a date picker which should show data only on dd/MM/yyyy format. When selecting the date and clicking save button, the date string is parsed using Date.parse and the date is ...
2
votes
1answer
1k views

Format date as two digit month and day

How do you set the .format() method to create a two digit month and day? I have tried this myDate.Format('dd/MM/YYYY') The .format() method has no example of this on the support page. https://...
5
votes
1answer
363 views

Apex - Getting list of dates in month - CPU timeout

I am getting a CPU timeout from my loop. I have checked the debug logs and my start and end dates have the correct dates in them. I have tried setting the condition to be dtoday.adddays(3) just as a ...
4
votes
2answers
2k views

Convert the any locale date format to US date format in Javascript lightning

I have been struggling to change the date format to US locale time. I tried so many methods but if fails at some or other scenario. The issue is I cannot say which Locale the client will be using. ...
5
votes
1answer
929 views

What are the minimum and maximum valid dates in Salesforce?

What are the minimum and maximum valid dates in Salesforce? What is the valid date range in Apex, SOQL or SOAP API? It is hard to find anything in the documentation
-2
votes
1answer
908 views

Report: Last Activity date 30, 60 day

I'm trying to run a report and group them by 30, 60, 90 days last activity date. Do I filter by 30, 60, 90 day or how should i do this?
0
votes
1answer
182 views

Making 24 hours difference in formula

what is 1.8 in this expression. I have seen people using now() + (-1.8) or now() + (1.8) for making 24 hours difference. What exactly is 1.8
1
vote
0answers
131 views

How to Calculate the CreatedDate Day of the Week In Process Builder

I've been trying to determine in process builder what date of the week the created date is but I keep getting an invalid formula error without details on what is incorrect. If I try either of the ...
0
votes
1answer
117 views

Same start and end date

For a custom object, I have two date fields : start date and end date. I want to make sure the end date is greater than start date. As per https://help.salesforce.com/articleView?id=...
6
votes
1answer
240 views

Test.setCreatedDate not working in SOQL Query with condition date set in future

I have an issue with Querying a record in a unit test with a custom set createdDate using the method Test.setCreatedDate(); static testMethod void test() { Account a = new Account(name='myAccount'...