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

I want to create a method in apex to check if the date format is in 'mm/dd/yyyy'

I have created this but getting an error>> "Condition expression must be of type Boolean: String" public static boolean validateDateFormat(String date1){ DateTime validDate = ...
0
votes
0answers
22 views

Calender not coming up on VF page input field

I have below VF page code . I am fetching values from controller . So there are mix of data types coming from it which are date type ,string ,integer . <apex:pageBlockSection title="Inputs&...
1
vote
1answer
15 views

Modifying a Dynamic Date Range by Month with AMPScript in Email

this might be helpful for some, but I also feel like it might be able to be improved upon or simplified. I have a recurring email campaign once a month that offers a new promotion for the course of ...
1
vote
1answer
20 views

SSJS DataExtension.Add FieldType Date… What does the “Ordinal” parameter mean?

I'm building a Data Extension using SSJS for the first time and the documentation is horrible. There's no syntax guide for the various field types. I'm wondering what the purpose of the "Ordinal&...
0
votes
1answer
30 views

Can Wait By Attribute honour the dynamic dates in Journey?

I have a 'Wait by Attribute' in my Journey which is referring to a date attribute in a data extension from contact builder. I then have a SQL criteria to change the Date values based on certain ...
2
votes
1answer
24 views

What is the best way to correctly create a string with a time queried from SOQL which needs to be displayed to Germans?

We have a custom Datetime field on a custom object, Appointment__r.Start_Date__c. At 6pm, the day before the appointment, we must send every customer with an appointment an SMS which reminds them of ...
0
votes
0answers
11 views

How to get the current quarter start date and no. of days in the current quarter in apex [duplicate]

How to get the current quarter start date and no. of days in the current quarter
2
votes
1answer
51 views

Date.today() gives different dates on different classes

These are the two classes I have written: aura:component controller class public class ResourcesComponentClass { @AuraEnabled public static void getDate(){ Datetime dateObj = Date....
2
votes
2answers
29 views

Date problem in Apex

I am generating current date in the js controller class. And, in the helper class, When I call the Apex method I am sending the date to apex as parameters. Here's the code: //controller.js ...
1
vote
2answers
75 views

Converting Datetime to Date returns date in the past

Datetime conversion of a custom datetime field to a date value doesn't work correctly. This behavior isn't explained in Salesforce's documentation as far as I know. Set your org & user to Pacific ...
1
vote
1answer
35 views

How to filter on CreatedDate using a date range in SOQL?

I'm having problems trying to filter a query by CreatedDate using a date range. The query returns always a wrong set of records. For example, if I want to get all records created until 2020-07-28, it ...
0
votes
2answers
37 views

Display Month Name and Year based from Date field eg: September 2021

Any assistance would be much appreciated! Looking to build a formula field that extracts Month and Year of a custom date field. (if it is 28.09.2020 as the date then the formula field would display ...
0
votes
1answer
34 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
2answers
70 views

How to format a date in a javascript?possible [closed]

How can I format a date object to print as today instead of showing a numeric date in a javascript? I'd like to display it like this: today At 5:00 PM. js var today = new Date(); var date = new Date(...
0
votes
1answer
40 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
1answer
30 views

How to format date field to ISO 8601 format?

I need to have a Date field send in an apex API callout in the format that matches this format "2019-05-28T19:40:36+00:00" I currently have the following: Datetime startDate = datetime....
0
votes
1answer
44 views

Convert date field to ISO 8601 format in REST API Post Callout

The external site that I'm trying to send Salesforce data to, requires that all dates/datetimes must be in ISO 8601 format. I am curious about how to accomplish this within my Apex class. The field ...
1
vote
2answers
35 views

Salesforce date format

The system I'm importing data from has a date format that looks like this: 8/8/2019 5:58:23 PM. Unfortunately there is no way to change this format with other software and it is not recognized as a ...
0
votes
1answer
10 views

Given the week number, how to find the start date of that particular week?

Given the week number, how to find the start date of that particular week using a Formula Field?
1
vote
0answers
76 views

lightning input type = date, max attribute behaviour not similar in production and lower enviornment

I used max attribute of lightning input type date to disable the future dates in date picker. It was working in lower environments, but not working in production. In Lower Environments: It shows the ...
0
votes
1answer
41 views

Call a toast event in the Lightning Web Component date selector

Hi I have req where user select the date after the maximum date then i need to show the error toast message in saledforce LWC , can anyone help me out for the req. Below is the code let today = new ...
0
votes
1answer
17 views

add Datetime values inside IN query clause in a different context

I am trying to create a query dynamically which contains the Date and Datetime values with IN clause with WHERE For example, SELECT Id FROM Opportunity WHERE Program__c IN ('Online','On Campus') AND ...
0
votes
0answers
49 views

System.now() gives different value than expected?

For example if DateTime is : DateTime dt= Datetime.newInstance(2020,07,12,18,30,0); //using System.now() for dt DateTime.newInstanceGmt(dt.date().addDays(-5),Time.newInstance(00,00,01,00)) ;// should ...
0
votes
1answer
26 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
82 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
143 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
20 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
40 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
201 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
86 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
39 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
18 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
20 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
44 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
30 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
43 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
174 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
137 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
1answer
20 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
10 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
26 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
96 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
18 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 ...
1
vote
1answer
71 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
70 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
64 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
41 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
40 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
188 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 ...

1
2 3 4 5
12