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
0answers
18 views

System.now() gives different value than expected?

For example if DateTime is : DateTime dt= 2020-07-12 18:30:00 DateTime.newInstanceGmt(dt.date().addDays(-5),Time.newInstance(00,00,01,00)) ;// should give 2020-07-07 00:00:01 but gives 2020-07-08 00:...
0
votes
1answer
12 views

How to put filter in report for dynamic last month?

I am trying to filter out records in my salesforce report like i just want to see last month records (Created Date). See below what i have done so far, Date filter on Created Date > CUSTOM > 02-...
0
votes
0answers
24 views

Reset invalid value in lightning-input date to a blank value on click of a button

I have a lightning-input of type date. When I enter an invalid value in this field, there is a validation displayed 'Your entry does not match the allowed format MMM d, yyyy.' I want to clear this ...
2
votes
1answer
117 views

Dates appearing one day before the actual date

I am displaying a Lead list using a datatable inside a aura:component. This is the table i am displaying: I am developing this app from India. And, when the client opens the same app from USA, this ...
0
votes
1answer
17 views

Format String Visualforce Component in a Custom Visualforce Template

I am struggling with something I think should not be difficult but I am not able to figure out, my date field display as the below screenshot. My aim is to remove from the template the characters 00:...
0
votes
1answer
35 views

How to dynamically change the start time in the query body of REST API

I am doing a REST API call using POST method with [SSJS]. In the body of the API i am sending the following parameters. var start= { "activityTypes": [ "Wait" ], "start": "2020-...
0
votes
1answer
52 views

How to convert date to yyyy-mm-dd format using ssjs without timestamp

I am trying to convert the date to YYYY-MM-DD format using SSJS. But not able to do that. Getting NAN. var day = new Date(); var prevDate = new Date(); yesDate.setDate(day.getDate()-1); var test = (...
0
votes
1answer
55 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]...
0
votes
1answer
36 views

How to identify the % of time between two dates + how to find records between two dates using SQL [closed]

Relating to my question related to finding a date X% between two dates using SQL, I'm having a challenge resolving two other similar things: How to identify the % of time between two dates. Here's ...
0
votes
0answers
12 views

I need an “always up to date” ARR value in my accounts, based on opportunity values and dates

Hello Salesforce people, I have something I am trying to do in Salesforce, and I am coming up on a lot of limitations within the platform, and I wanted to ask the best way to do what I am trying to ...
-1
votes
1answer
18 views

Date format to MM.DD.YYYY

I'm trying to convert my datetime value into MM.DD.YYYY format Tried the following, 1. datetime dt = system.today(); string f = DateTime.newInstance( dt.year(), dt.month(), dt.day() )....
0
votes
1answer
19 views

Control going inside 'If' block even when it should not (only for 1 value)

I am trying to count the number of weekdays (Monday - Friday) by taking the number of days since 01-07-1900 (7th January, 1900), for a given date, and checking the modulus by 7. For modulus values 0 - ...
1
vote
1answer
39 views

Apex Date to string

I'm trying to display the Start date Concatenated with the End Date. To achieve this I've converted my date field to string and concatenating the string value. It works fine but in both start date ...
0
votes
1answer
29 views

Why does dateGmt() function contains a Time quotient at all?

Long startTime = 1112222220; Date startDate = DateTime.newInstance(Long.valueOf(startTime)).dateGmt(); system.debug('startDate: '+startDate); String qry = 'Select Id, Subject from Task where ...
0
votes
1answer
39 views

THIS_QUARTER is breaking SOQL query

I have a very bizarre issue with a batch job that is using the following query as a scope to generate new records Select id, Management_Fee__c, Payment_Schedule_Comments__c, ...
2
votes
2answers
136 views

AMPScript displaying wrong Date inside Journey that is triggered by automation - Reason?

The Problem A wrong date gets calculated by AMPScript GetSendDate with SystemDateToLocalDate inside a journey that is triggered by automations. Our SendLog DataExtensions has senddates displayed in ...
0
votes
1answer
48 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 ...
0
votes
0answers
12 views

Date based entry event not working

I've set-up a data based entry event as can be seen in the picture. When I run a similar query it gives me the people who have their birthday today. But the entry event is not doing anything, it is ...
0
votes
0answers
6 views

Import English (UK) dates into Marketing Cloud

I am trying to import a CSV with a bunch of customer information into Marketing Cloud. The import keeps failing due to Invalid Date: 7. I've been using English (United Kingdom) as the date format ...
0
votes
1answer
21 views

Date Field - Timezone Issues in Batch Job

I'm seeing peculiar behaviour on a Date field (not a DateTime field) when we utilize these date fields in a batch. For instance using the code below: endDate = Date.newInstance(startDate.Year(), 6, ...
0
votes
1answer
44 views

Problem with Date format in SOQL

I have a silly problem, when I pass Date from lightning input (type=date) i pass it as a string, and when i creating a query with this paramiter i recived error like below value of filter ...
0
votes
0answers
16 views

SOQL queries with date literals

I am trying to send a SOQL query to salesforce using jsforce. I would like to select all opportunities that are closing within the next year. I firstly tried to use a javascript date but I get an ...
0
votes
1answer
33 views

I'm getting this error when i'm trying to add days Error: Method does not exist or incorrect signature: void addDays(Decimal) from the type Date

if(application.genesis__Lending_Product__r.Name=='Restructured Term Loan') { loanAccount.loan__Accrual_Start_Date__c= systemDate.addDays(application.Deferred_Payment__c*7); }
0
votes
1answer
66 views

How to enter date and lookup field into an object

I rewrote the code, through anonymous works. I only have a problem with the date and field Log__c (lookup). public class ExampleExchange { @AuraEnabled public static List<Exchange_Rate__c> ...
2
votes
2answers
58 views

Get records created on a specific day

I'm programming a batch that needs to mail community users if they've created their user exactly account 39 days ago. It seems difficult to query on a specific day ... I first tried : Date limitDay =...
0
votes
1answer
34 views

Convert two separate fields Date and time fields to milliseconds

I have two separate fields Date and Time fields. I would like to convert these fields into seconds format. I am using this seonds format to make google API call. https://maps.googleapis.com/maps/...
0
votes
2answers
21 views

Automatic Date Stamp on a Stage Change

I want to add an automatic date stamp when an opportunity moves from Stage 1 to any other Stage that isn't closed.
0
votes
0answers
89 views

set default value/auto-populate required close date field when creating new opportunity

When a user creates a new Opportunity the Close Date field is required to be entered. However, the requirement is to automatically set this field to 1 date from when the opportunity is created. I ...
2
votes
1answer
267 views

extract year, month, day, from date field in a report? [closed]

I was wondering if it would be possible when creating a report to have individual columns for each portion of a created date field (column for year, column for month, column for day)? I know I could ...
0
votes
1answer
48 views

Modify Date Range

How do I modify the code below to have the week range from Thursday 12 PM Central Time Zone to the following Thursday 12 PM, so setting the Start date of the week to be Thursday and end week to be ...
0
votes
1answer
290 views

lwc convert date from text to lightning-input of type date

I have a component which is displayed in a custom data table column for a text field having date value. By default text value dueDate along with Edit icon gets displayed. When the edit icon gets ...
0
votes
2answers
46 views

Change date format in formula to MM/DD/YY

I have a formula that uses a date field that returns a date with a format DD/MM/YYYY. I need to change the format of this date to DD/MM/YY. TEXT(DAY(ExpectedDeliveryDate__c))+"." +TEXT(MONTH(...
0
votes
1answer
73 views

Journey Builder recurring based on Date field

I have a question about Journey Builder. I have built a journey that is supposed to evaluate contacts on a monthly basis based on specific date field. I have configured the schedule as recurring ...
3
votes
1answer
167 views

How to output [MMMM dd yyyy hh:mm AM/PM] using Text formula on a DateTime field?

Good day StackExchange! High level, my goal is to take a date/time value and use a formula to display it as a customer friendly long date (MMMM-DD,YYYY at HH:MM AM/PM) string output for email ...
0
votes
0answers
27 views

A Posted Solution to a lightning:formattedDateTime Problem No Longer Works

I have the same problem asked about here, where the date displayed by the lightning:formattedDateTime component does not match the date field that's its value. I attempted the answer chosen in the ...
2
votes
0answers
33 views

Get # of days for week number X

Is there a way to get the total days or hours of each week of a month? I am using WEEK_IN_MONTH() to get the week number but now I need something like HOURS_IN_WEEK() or DAYS_IN_WEEK() which I can ...
0
votes
2answers
100 views

Newest records for a SOQL Query

I have the Object Case and the Object Agent and I have multiple Agents created by Case. Both of them have their Ids. Agent has a field CaseId and I want a List with the newest Agents related with a ...
3
votes
1answer
217 views

Max attribute is not working properly for input type date

Hi Currently I am facing issues in the "Max" attribute in lightning-input but max attribute is not working properly in some cases. My requirement is to disable dates after One year of the Current ...
3
votes
1answer
289 views

Issue in Finding Difference between Date's in LWC

Currently, I want to find a difference between two dates in months in LWC. I am getting a difference as 'Nan'. Here is the playground link Below is the screenshot for your reference
1
vote
1answer
50 views

Changing Date time using DateTime - format(dateFormatString, timezone)

In below execute anonymous code I am seeing a strange behaviour. DateTime myDateTime = DateTime.newInstanceGMT(2019, 12, 30, 0, 0, 0); system.debug('myDateTime === ' + myDateTime); DateTime ...
1
vote
1answer
19 views

Invalid date and time error [duplicate]

I have a @restResource that's receiving a JSON payload as a string. I am taking that payload and placing it into a Map<String, Object> variable. I'm trying to save the date/time into a variable ...
1
vote
1answer
143 views

Process builder conditions when custom date/time is NOW()

Should be simple but I'm getting stuck on the formula Building a workflow in process builder and trying to trigger an action when custom object's custom date/time field is NOW().
0
votes
0answers
29 views

Date Format of DateTime in Select/Aura Iteration

Here is the code : <lightning:select aura:id="SelectRepport" name="PaymentType" label="repport Z" onchange="{!c.zRepportSelected}"> <option value="0">Chosse ...</option> <aura:...
1
vote
0answers
15 views

Is Salesforce Advanced Formula Example for Business Days Incorrect?

Throughout the year we have been using the following formula field from Salesforce Advanced Sample Formula to calculate the number of business days: This is recommended on the Salesforce Website ...
0
votes
1answer
28 views

how to write formula to get year end date based on system.today

how to write formula to get year end date based on system.today.ForExample: if i open 1/1/2020 that field will be show 31/12/2020 like that i need formula
0
votes
1answer
70 views

Convert Birthdate to Getdate

I am trying to send a message to everyone whose birthdate is in two weeks but the date is of a different format and the query thus returns 0 rows. The query I am currently using is the following ...
8
votes
1answer
159 views

Which date format to use with inputs for the Quick Actions REST API? (INVALID_TYPE_ON_FIELD_IN_RECORD)

I'm receiving the error INVALID_TYPE_ON_FIELD_IN_RECORD when invoking a custom sobject quick action to create a record and its payload specifies a Date or DateTime field as an input value. For ...
1
vote
1answer
28 views

Date formatting for SOQL String - unexpected output

I have '273' added as a day with the following line: DateTime.newInstance(dStart.year(), dstart.month(), dstart.day()).format('DD-MM-YYYY'); so the output looks like '273-09-2019' - what gives? I ...
1
vote
2answers
52 views

JSON Date field Error

I have the JSON string below that is being sent to a Salesforce Webservice: {"Opportunity": {"Id":"006g000000IiM5z", "Appraisal_Date__c":"2019-11-22"} I serialize the request into a Map and am ...
3
votes
1answer
210 views

Aura localizationservice: broken format/parse with some locales

We're having an issue with a custom-build form date input component. The component formats Javascript date objects into user-friendly strings for user display/input, i.e. "5 May 2019", and then parses ...

1
2 3 4 5
12