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
0 votes
1 answer
23 views

How can find no of working days between CreatedDate and one user created Date field in apex

I need to find no of working days between CreatedDate of record and a new custom field of Date.I am using businesshours to find no of working days. the issue is CreatedDate will return DateTime object ...
-1 votes
2 answers
2k views

Formula to put a date together seperatly Fields "Month" and "Year"?

In an custom Oject, that is filled with external market development data I got a picklist field "Month" (Picklist: 1,2,3,4...12) and a picklist field "Year" (picklist: 1990, 1991, 1992... 2020). Each ...
0 votes
1 answer
2k views

How to remove the time 00:00:00 from a date format and still maintain the date type

PROBLEM: I converted a string to Date format. Eg: String dateToParse = year+'-'+month1+'-'+day; Date ds = Date.parse(dateToParse); OUTPUT: 2020-07-24 00:00:00 (output is a Date type variable) Expected:...
1 vote
3 answers
3k views

Formula Question: Record a date of first activity on contact object

I need to create a custom field on my Contact object that records the date of the very first call that has happened with a Contact record. I thought about creating a formula field on Contact, and ...
-1 votes
1 answer
36 views

Get time to close, instead of days

I'm trying to get a column added to a Salesforce report for case management. Using the SF Lightning experience. There are 2 fields available currently: Date/Time Opened Date/Time Closed These fields ...
0 votes
2 answers
1k views

How to use long date format in LWC

So I've been trying to understand the use of dateTime.longDateFormat in the documentation located here: [https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_i18n][1]...
-1 votes
0 answers
25 views

Planning to automate a weekly email which should go every thurday , and it displays trainings happening for that day

Requirement is to automate a weekly email which should go once a week, and it should display content from a DE (content & header) for that day. Test_DE fields: Content Header Date Here is the code ...
1 vote
2 answers
775 views

ui:inputDate updating error

<aura:attribute name="dueDate" type="Date"/> <aura:attribute name="dueDateString" type="String"/> <aura:handler name="change" value="{!v.dueDate}" action="{!c.dueDateChanged}"/> <...
3 votes
4 answers
5k views

How to calculate duration between two dates(in months and days) using formula field?

My client wants me to write a formula field to return the duration(in months and days) between two date fields. For ex: If start date is "January 1st 2016" and end date as "December 31st 2016" then ...
0 votes
1 answer
175 views

Unable to calculate days in apex

I need to calculate days between two fields. So I use daysBetween to complete when I try to do with two dates. When I try with single values. But, when I try with list it throws an error like: Method ...
0 votes
1 answer
1k 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
0 votes
0 answers
22 views

Unable to find the correct syntax in a Row-Level Formula

Like others, new to salesforce and struggling with what is likely a simple issue, please forgive. I am working in Leaseworks, an application written on the salesforce platform. I have a column of ...
0 votes
1 answer
39 views

converting DateTime to String returns the wrong Date as a String

I have the following code to get the DateTime for EST Time Zone Timezone tz = Timezone.getTimeZone('America/New_York'); DateTime now = Datetime.now(); Datetime localTime = now.addSeconds((tz.getOffset(...
0 votes
1 answer
785 views

Combining relative and static date filters in the dataflow Salesforce Wave/Einstein Analytics

I've created an opportunity, revenue, account, accountplan dataset. On the opportunity is a highly complex revenue logic so we decided to have a revenue field for each month. To get all those objects ...
-1 votes
2 answers
174 views

Calculate the Fiscal Quarter of a Date in a Formula Field if the FY starts in Aug

As the title suggests I'm trying to identify the fiscal quarter a CloseDate of an opportunity falls in, provided that the FY starts in Aug. I have tried this as per document: https://help.salesforce....
1 vote
1 answer
121 views

Best practices Use == or isSameDay apex date

Currently in production I check if two dates are identical in apex by doing date1 == date2 I see in the documentation that there is also isSameDay Would you know if using == between two dates is a ...
0 votes
2 answers
2k views

Convert a datetime to date in SFMC

I have an issue converting a date/time to a string format date. Indeed, I would like to change the following date format : 'mardi 15 mars 2022 4:24 PM' to this format '15/03/2022' without the timedate....
0 votes
1 answer
27 views

How do you write DATE() with a wildcard on year?

In my flow, I need to check whether a record's date month and day match a specific date but not the year. So, I have a basic decision item that looks like this: {!Record.StartDate} = DateVariable I ...
0 votes
2 answers
782 views

How to update task due date as last working day of current month

I want to update a task due date as last working day of the current month for only one recordtype using an apex class. It should exclude the weekends and holidays. I wrote the code below to achieve ...
-1 votes
1 answer
96 views

Validation Rule to Restrict date within current fiscal year?

I need help creating validation rule to restrict date between the Current Fiscal year of the company. Say, the user should be able to only select dates between Oct 1 to September 30 of the following ...
0 votes
0 answers
218 views

"The request body is either invalid or incomplete."

I'm using the analytics studio to build a dashboard right now. I put 2 reports about campaign influence, that I created via "Reports", one for customers and one for prospects. I want to put ...
0 votes
1 answer
5k views

How to Blank Date value in Date formula field?

This field is to display the "date" value when this Opportunity's Stage value contains "Closed ". and at the same time Opportunity's Stage value not contains Closed means this ...
0 votes
2 answers
77 views

AMPScript: Is there an easy way to have dynamic date format based on Same Month vs Different Months?

I want to create a list of events that will show event start dates and end dates. I have a data extension that stores the StartDate and EndDates. Is there an easy way to make the date format dynamic ...
2 votes
2 answers
1k views

DatePicker Issue

I have two text field: One normal text field that accepts numbers. <apex:inputField value="{!FinancialAssCont.Down_Payment__c}" styleClass="form-control downpaymentAmount" onblur="...
0 votes
1 answer
57 views

How to use order by clause for dates

How would you go about getting the most recent date from a table? I've been trying to use the clause order by but I get back the following error: "An error occurred while checking the query ...
0 votes
1 answer
105 views

If a record exists with the same Date as another do not create the record

I have a Salesforce/Visualforce page which allows my user to create entries out of a list of users by dragging them onto a sudo-schedule. Once the entry is created it will display some basic ...
-2 votes
1 answer
83 views

Date Parsing In Apex

I am having birthdate like this as string 'November 1, 2012' and I want to find the age pertaining to current date. I am trying to convert first into date as like below Date.parse('November 1, 2012') ...
2 votes
3 answers
5k 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 &...
0 votes
1 answer
122 views

Converting PST time to UST TIM

I am having a time like this which is in PST Time zone '2022-12-29 08:00:00' and I am trying to convert this into UST whose output has to be as '2022-12-29T16:00:00Z' 2022-12-29 08:00:00 (PST) --> ...
0 votes
0 answers
86 views

Apex Insert Date time as it is

Inorder to book appointment in FSL I am reading the available time slots for the service resource using getAppointment REST API and here is the response from API { "candidates": [ { ...
1 vote
1 answer
87 views

Field Formula for Soonest Date After X Amount of Days

I'm trying to create a couple of fields to calculate the eligibility date for employee benefits. -The first one should return a date of either the 1st or the 15th of the month 60 days after Hire Date. ...
0 votes
1 answer
158 views

Format Date from Datatable selectedRows

In my LWC I have a Datatable with a column for "Date From" - below is the column configuration { label: 'Date From', fieldName: 'werDateFrom', type: 'date', sortable: true, ...
0 votes
0 answers
49 views

How do I put a DATE type value in a String field in a Marketing Cloud data extension

I'm trying to do this sql query, but I'm getting an error when converting the type date to string.... I've tried using CAST/ CONVERT/ TRYCAST .. but I must be doing something around because Marketing ...
0 votes
0 answers
226 views

Calculate Salesforce Case response time

I'm new with salesforce formula and I have this requirement to compute the business hours with mins. in salesforce case. what i did is that i set-up one field in case objects (data type = formula). ...
-2 votes
1 answer
90 views

AMP Script - Populate last date of the third month in DD-MM-YYYY [closed]

set @todayUS = Now(1) set @tomorrowUS = DateAdd(@todayUS, 1, "d") set @yesterdayUS = DateAdd(@todayUS, -1, "d") set @threeMonthsDate = dateadd(@today, 3, "M") set @month =...
0 votes
0 answers
49 views

Populate in my date field the latest date

I have 2 records types in my asset : The licence with a field "expiration date" and The module with one checkbox and one "Contract end date" I succeed with a flow to populate my ...
1 vote
1 answer
657 views

Salesforce Contracts - Testing on Contract term/End Date

I have a class that is looking for contracts 30 days before the end Date. My problem is i am trying to build a test for this class, and in that i'm trying to create a contract where the End Date is ...
7 votes
3 answers
47k views

Converting Date to DateTime

Added due date on case which is a date field. Trying to get this as dateTime and here is my code: case c = [select id, caseNumber, Due_Date__c, status, type from case limit 1]; Date i = (c....
0 votes
1 answer
2k views

ValidationError (Invalid Date) when importing a CSV to a Data Extension with a Date type field

I have extracted the _open Data View from an old instance and tried to import the 139K CSV records into a Data Extension in the new instance. However, I got a problem with the "EventDate" field when ...
1 vote
1 answer
44 views

Date.parse parses weird dates with no typeException

Date.parse('30/30/2019') works different in sandboxes. Everywhere typeException is thrown as expected, but in one sandbox this date is being parsed into 2021-06-30 00:00:00. I checked everything - api ...
9 votes
1 answer
216 views

Winter 23 - ICU date Formats - Date.parse

I have observed in the last few days the following (locale = en_US): Date d = Date.parse('15/56/2023'); // run with api V55 System.debug(LoggingLevel.INFO,d); Environment ICU enabled? ...
0 votes
0 answers
147 views

Displaying Year in the footer of a custom salesforce email template

Question is: How do you display the current year in a Salesforce classic HTML email template? This would be where the copywrite section with the 2022 goes. This way it doesn't have to be manually ...
-1 votes
2 answers
30 views

Error in date class

I am tr4ying to concatenate two date fields. But I'm getting this error: "Date expressions must use Integer or Long" eg: System.debug(date.today()+date.today());
0 votes
0 answers
51 views

After Winter '23 release, some orgs suddenly enabled the test run for the ICU release update

This Monday, after the Winter '23 release went live this weekend, we were surprised that suddenly the test run of the ICU Locale Formats release update was enabled. Did more people have this happen? I ...
1 vote
1 answer
502 views

Using Date fields in process builder as conditions

I am trying to use date fields as part of my condition in a process builder to say: If field #1 (number) has value > 0 AND field #2 (date) is less than 30 days ago (ie. date is within the last 30 ...
1 vote
1 answer
63 views

Getting a wrong date format when getting inbox messages on Android

I'm using the react native sdk for SFMC and I have some difficulties with getting the inbox messages from the Android platform. Somehow the date format is like: Fri Sep 30 11:16:00 GMT+02:00 2022 And ...
-1 votes
2 answers
213 views

Can I set the field CloseDate on Opportunity to null or blank?

I know that I can use some workaround like that: opp.CloseDate = Date.valueOf('1900-01-01'); But is there a possibility to have that field not visible for some (cloned) Opportunities? (beyond hiding ...
1 vote
2 answers
9k views

How to pass Date as parameter?

I am trying to create new opportunity passing 3 arguments into a method. how do I pass date since it is one of three required fields? Below is what I have at the moment. public static void ...
-1 votes
1 answer
695 views

How to get start and end date of a specific quarter

I'm looking to update the start date & end date of the specific quarter based on the year and quarter fields selected by the end user. I thought of trying with the Period object but I'm unable to ...
1 vote
1 answer
61 views

Remove time stamp from a Salesforce Field in Marketing Cloud

I do want to remove the time from a Salesforce field retrieved from the object CampaignMember. I had tried this the following amspcript code in my email but I do still have errors to send it : %%[ VAR ...

1
2 3 4 5
14