Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
2 votes
1 answer
26 views

Does Date.addDays() method skip the weekends based on the Org's Business Hours settings?

For example when I use Date.addDays(1) for a task's due date. I realized if the next day falls into a weekend both Sat and Sun are skipped and it adds 1 workday (which is three days count). Now, this ...
user avatar
  • 596
-1 votes
1 answer
29 views

Unable to see last login or the login history for some users

when i go to Setup----> users-----> i could see the list of users. I could not see the last login date for some users and also the login history for them. Can i know the reason for it.
user avatar
  • 1
0 votes
1 answer
28 views

Validate records by date ranges in SOQL and apex en bulk

I have a custom object with two dates - start and end. When inserting multiple records, I want to ensure they don't overlap at all. Naive implementation: global with sharing class OverlapFilter_TDTM ...
user avatar
  • 4,429
0 votes
2 answers
34 views

Calculating the start of a new month in SF

So essentially what I'm looking for is to be able to calculate the start of a new month. So for context, there is a checkbox that I want to clear at the start of every new month (if it's ticked ofc). ...
user avatar
0 votes
2 answers
44 views

Formula field date subtraction

I have a formula field as a boolean which should return true if the date of today and enddate has less than 3 months in between and the enddate field is not empty. I dont get the correct results. ...
user avatar
  • 2,068
0 votes
1 answer
44 views

Format a date in a Flow?

I used in my flow a custom field of type date which returns to me in the email action a value of the date in the form of month Daye , Yers , what I want is to have the value of the date in the form DD/...
user avatar
0 votes
1 answer
22 views

Date format in lightning-input after changed input value format

An issue in Date format validation in lightning-input type Date: After I changed the input value format according to the latest Salesforce updated ICU locale format for Ireland. The last column shows ...
user avatar
0 votes
1 answer
34 views

How to set Date field to Null or Blank using flows?

I am trying to set a date field to Null when there is a checkbox set for a record. I have tried using Formula field of type Date and setting it to Null, using process builder global constant and tried ...
user avatar
  • 1
0 votes
1 answer
23 views

AMPScript convert "feb" to 02

I'm looking to convert a data field value (@OPT2) from "01-Feb-22" into "01-02-22" to be displayed on a landing page. The reason is I want to display the date in French too and ...
user avatar
0 votes
1 answer
26 views

How to get the range of Fiscal years from FiscalYearSettings based on Current FIscal Year Dynamically?

I am trying to fetch the Fiscal Year Setting Records using SOQL for the fiscal years based on current fiscal year. I need few records before the current fiscal year and a few records after the current ...
user avatar
1 vote
1 answer
25 views

How to Update List of Account in visualforcepage?

Iam new at salesforce, anf need your help and advice guys. there is a list of account objec and I want to update PPDDate field (custom type date). i can update several PPDDate at once then press the ...
user avatar
0 votes
1 answer
35 views

String to Date in SQL

I have the following problem: I imported a csv file in MC and there is a date field in it. When I create the billing_date attribute as text field, all of the csv data will be imported correctly and ...
user avatar
  • 1
0 votes
1 answer
17 views

condition form not Leap Year issues

I want to express this condition with my formula taking into consideration the date of 02/29 End date >= Current date + 365 then green End date between Today's date + 1 and Today's date + 364 then ...
user avatar
-1 votes
1 answer
37 views

Formula condition with date

I have this formula type field, the condition is correct but the problem I have is that when it is 02/29 as the end date, my field gives me an error, is that because I I used yers -1 maybe, if not, do ...
user avatar
0 votes
1 answer
55 views

Compare date in lightning web component

I want to compare my two dates, start date with end date, if start date >= end date so I can save if not I can't save, the problem I have is that in the console I get only the value of the end date ...
user avatar
0 votes
0 answers
30 views

How to obtain translated full day name from date in Apex?

In Apex, the name of the day can be derived from a date using the format('EEEE') method: Datetime targetDate = Datetime.newInstance(2022, 4, 28, 0, 0, 0); String dayOfWeek = targetDate.format('EEEE'); ...
user avatar
  • 3,230
0 votes
1 answer
33 views

Date.addDays not working in a loop

I have this code that creates opportunities for every day given a period start and end date. However I see that the addDays is not working as the resulting value is the same as the start date. Why ...
user avatar
  • 197
1 vote
1 answer
35 views

Trigger on difference between 2 date fields - not working

I'm a beginner in APEX and I'm trying to develop a trigger on Service Appointment that will auto populate the Work Duration field with the difference between the Schedule End date and Schedule Start ...
user avatar
0 votes
1 answer
35 views

Close a case X days from its opening - Salesforce

What I am trying to do is that when a new case is created, if it does not advance from the new status, it will be closed in 14 days from the date of creation. [ [ [ [ I have this trigger-flow but it ...
user avatar
  • 3
0 votes
2 answers
103 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....
user avatar
  • 27
0 votes
1 answer
21 views

Aura Component get time from Server as opposed to JavaScript/Client Side/Browser Time?

We have an intake form built using Aura Components and its a simple form. The submit button on the aura component is enabled or disabled depending on what time it is. Basically, they are not allowed ...
user avatar
  • 362
-3 votes
1 answer
42 views

Date formatting not working in Apex

I am trying to convert the date in a date field to different time zones using format method. But it is not getting converted. Below is the sample code. Account acc = [select id, custom_date__c from ...
user avatar
0 votes
0 answers
41 views

Convert function with date formatted as text

I have a DE1 with field named 'DATE_A' with datatype text. This field contains records that are formatted like this: yyyy-mm-dd hh:mm. Using sql query activity I should retrieve records with field ...
user avatar
  • 71
-1 votes
1 answer
57 views

Report with a Date Range?

Is it possible to create an opportunity report that reviews opportunities by a date range field (like January-February) instead of a singular date field (like "Created Date")?
user avatar
0 votes
0 answers
23 views

How to best track opportunities by their products' "active" dates for a report?

Simply stated, my goal is to write an accrual report that lists all closed/won opportunities by each month (with each month including in an opportunity only if any of its products are active during ...
user avatar
2 votes
1 answer
276 views

Date in LWC - Year field shows extra values

When the user selects a year for Date, an alphanumeric value appears next to the year. Does anyone know how to remove this extra alphanumeric value? any help is greatly appreciated! This is a custom ...
user avatar
1 vote
0 answers
45 views

How Can Dates From an Org and a User's Personal Machine be Reliably Compared to One Another (LWC)?

I have had some trouble comparing dates retrieved from an org and using them in a Lightning Web Component in order to tell whether or not a certain record has 'expired' in order to display said ...
user avatar
0 votes
0 answers
41 views

Use DATEVALUE in formula on REFERENCED date/time field

I have the following formula on the case object: TODAY () - DATEVALUE(Object2__r.LastModifiedDate) But after I insert this field on the report nothing shows (I want show the day difference between ...
user avatar
  • 335
-3 votes
1 answer
58 views

How to convert string in Date format? [closed]

I have a string like this : '20170206' I need to convert it into a date like that : 06/02/2017 String birthdayDate = '20170206'; Date dt = Date.parse( birthdayDate); system.debug(' Parsed Date is ...
user avatar
0 votes
0 answers
44 views

How to formate date picklist in lightning-datatable to 24 hours format

I have datatable column with type="date" which display hours/minutes/seconds in 24 hours format, like this: recordTime: { label: this.labels.recordTime, fieldName: '...
user avatar
  • 15
3 votes
1 answer
1k views

Set default value to Date input in lwc

I am trying to set a default value to the date input field in the lightning record edit form (Today + 90 days). I have done the below code but it is not recognized in MMM d, yyyy format. var someDate =...
user avatar
  • 295
0 votes
1 answer
23 views

How to get only last two character from current and next year date in aura controller js

I have used the below code to get current and next year but it's coming as 2021 and 2022 but I only want 21 and 22 from the below code. Please suggest. var today = new Date(); var currentyyyy = today....
user avatar
1 vote
1 answer
270 views

How to correctly convert Unix Timestamp to datetime in SQL

I'm trying to get the date format dd/MM/YYYY or anything readable. actually I have the date data with this format stocked in a string field "1620305130000" I have tried the following CONVERT(...
user avatar
  • 49
0 votes
1 answer
202 views

Salesforce formula to get last day of previous month after one year

I have validation rule which will throw if the selected date is not last day of previous month after one year Example - today is Oct 1,2021 then my validation should fire if selected date is not Sept ...
user avatar
0 votes
2 answers
96 views

How can I make a year in a SOQL query variable?

So I can run a query such as WHERE Date__c > 2020-07-31 but then next year "2020" would be out of date. I'd like "2020" to be variable so that next year, when I run this again, ...
user avatar
  • 13
0 votes
1 answer
28 views

JavaScript setHours is setting less hours than specified by parameter

function removeDaysToDate(date, hours){ var res = new Date(date); console.log('res ->' + res); console.log('hours ->' + hours); ...
user avatar
  • 157
0 votes
1 answer
193 views

How to find different between two dates in aura Component?

I am try to get number of days between two dates. here is my code-- Var first = new Date('2021-09-01T03:24:00'); Var second = new Date('2022-09-02T05:24:00'); Var Difference = second.getdate() - first....
user avatar
0 votes
1 answer
29 views

Default Date/Time In Medium Format 28 Jan 2008, 16:30:05 instead of 28/01/2008, 16:30

Company would like to display the Date format in SF to show the month as text (e.g. Jan instead of 01). From the following article this appears to be the a OOB option by setting the users Local to ...
user avatar
0 votes
1 answer
61 views

Date.newInstance function not throwing error when we enter invalid date

I am using Date.newInstance for entering the date through the apex. For example : System.debug('Test1'+Date.newInstance(Integer.valueOf('2021'), Integer.valueOf('2'), Integer.valueOf('31'))); The ...
user avatar
3 votes
1 answer
421 views

Marketing Cloud - API - Data Extension - Filter by Date

I'm retrieving values from a Data Extension using the GET method on https://[YOUR SUBDOMAIN].rest.marketingcloudapis.com/data/v1/customobjectdata/key/[EXTERNAL_KEY]/rowset without any filter the ...
user avatar
0 votes
2 answers
145 views

Remaining days in a month

I am trying to calculate some amount depending on the days. For first month it will have only 15 days and the subsequent month will have full days and last month will have 25 days(First and last month ...
user avatar
  • 59
0 votes
1 answer
725 views

Salesforce formula to calculate first day of next month

I am creating validation rule which will fire if date of a custom field is greater that first day of next month. I am using below formula in validation rule but it is not firing. Custom field is ...
user avatar
-1 votes
2 answers
561 views

Changing of date format in apex [closed]

1.How to change the 2021-06-15T02:30:00.000Z to date(15/06/2021) in Apex? I have tried multiple ways but not working please help me with the code.
user avatar
0 votes
1 answer
71 views

hour() and date() functions are returning wrong values

I am trying to get the hour and date of the user's local timezone by using the below code. now = Datetime.now(); offset = UserInfo.getTimezone().getOffset(now); local = now.addSeconds(offset/1000); ...
user avatar
2 votes
1 answer
655 views

Formatting problem with the Lightning Input date type

I am using the following two lightning inputs in a component I'm working on: <lightning:input name="startDate" type="date" dateStyle="short" value="{!v....
user avatar
  • 2,325
0 votes
1 answer
48 views

Salesforce Date Formula doesn't show proper results

Hi Salesforce enthusiasts! I need to troubleshoot existing formula in my organization (or create a simpler one) "Contract Renewal Date" (see below) which is supposed to show the date: ...
user avatar
  • 139
0 votes
1 answer
55 views

how to subtract/not consider a Date Range

I have field called CBN__c on child object Score and i need to rollup this to the parent account based on Approved Scores. I did create a batch class that updates Account's CBN field but i got a new ...
user avatar
1 vote
1 answer
174 views

How to find out which dates are missing in a period?

I have two dates (the start date of the period and the end date) that the user enters in the form to get a list of data. I need to get a list of this data from the database and check if there is a ...
user avatar
1 vote
2 answers
413 views

Apex - Count days or years between today and Date field (Registration date)

I need to make discount depends from Registration date (i.e. 3% discount to Opportunity when Accoun registered 1-2 years ago). Sample of code: for (Opportunity opp : TriggeredOpps){ If (...
user avatar
0 votes
1 answer
27 views

Subtracting Integer from Date returning previous date than expected date

We are trying to calculate "Date A" by subtracting 5 days from "Date B". For e.g Date myDate = Date.newInstance(2021, 06, 26); Date newDate = mydate.addDays(-5); System.debug('...
user avatar

1
2 3 4 5
13