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
57 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
81 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
25 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
32 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 ...
1
vote
0answers
70 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 ...
4
votes
1answer
69 views

Formatting Date and TIME in French

I followed this question/Answer to format date in French: AMPscript Date Formating for French Language in HTML emails Following this post, I would like to know how we should add the time to the date ...
0
votes
0answers
31 views

Rendering a date via lightning:formattedDateTime

When using date.today() for a community page it shows as yesterdays date in the community. If you look up the record in the system it shows properly as today. I've seen the post about the users ...
0
votes
0answers
12 views

How can I create a VF component that follows you like the header bar?

I need a component that will follow you from page to page like the header I need to have a visualforce component that simply shows a timestamp no matter where you are on the org.I was thinking ...
0
votes
1answer
33 views

How to use Select command in SOQL to return sysdate using a generic table or No table for from clause

For tests proposes, I need to get the current system date. On Oracle we could use: SELECT SYSDATE FROM DUAL On SQL SERVER, we can use: SELECT GETDATE() On DB2 we would use: Select current ...
0
votes
1answer
38 views

lightning:inputField type Date showing both Date Picker and history of dates, how to avoid showing history but show only the Date Picker?

I am using lightning:inputField with type as Date, the issue is this field shows two pick-windows 1. Date Picker and 2. Date-History picker. Please help anyone, if you know if there is any fix for ...
0
votes
2answers
73 views

Validate Date Format - Apex

I have a lightgning component for Account Creation / update. In this component i use as input field a date field. I want somehow to validate in Apex (Component Controller) that the date the user has ...
0
votes
1answer
78 views

Calculate Months between two dates? [duplicate]

On quote whenever user specifies Start Date and End Date we need to calculate Subscription Term which should be exact months, here it should say 12 months but its showing 11.96. Can anyone please ...
2
votes
1answer
35 views

MC Connector createdDate transformation

I believe there are some date transformations applied automatically when synchronizing records from SFDC to MC via the Connector I am talking about Created-date on Contact records for instance - I ...
0
votes
1answer
80 views

Get all records inside a given date

I need to get all the records that are inside a given date. What I have now is giving me only one of them randomly every time I run my query. Any suggestions on how to fix that? SELECT table1.Number ...
0
votes
1answer
45 views

Ouput date in ISO8601 date-time format

I need to output a date in ISO8601 date-time format in Salesforce using SSJS. Salesforce is storing in format 'Thursday, 1 August 2019 5:00 PM'. I have tried Write(current.date.toISOString()) but ...
1
vote
1answer
30 views

AMPscript: Including Ordinal Indicators In Date Formatting

I have an automated email that will be sent every month and I'm trying to get the expiry to reference the last date of the current month formatted to read 31st January, 2019 or 28th February, 2019. I'...
1
vote
0answers
30 views

AMPscript Dynamic Date MobilePush Message

Is it possible to reference a date attribute of a particular push message? As in something like: %%[ VAR @messageCreatedTime SET @messageCreatedTime = MessageCreatedTime ]%% Inbox Subject Line: %%=...
-3
votes
2answers
64 views

How to get the Latest record created date in salesforce?

I have a field called "Date" on custom object "TestData__c". If I create a record today I need to display today date.If I create a record tomorrow I need to display Tomorrow date.How Can I achieve ...
2
votes
2answers
28 views

Formula showing Day Of Week and CreatedDate as a Text String

I am trying to create a formula field that will return the Day of the Week concatenated with the date the record was created. The end result should look like this: Tuesday - 8/13/2019 I have this ...
1
vote
1answer
62 views

FORMATDATE and format pattern to add year when using format pattern “M”

I have this code SET @START_DT = "2019-08-05T06:07:08.1230000-06:00" SET @CHANGE_DATE = FORMATDATE(@START_DT),"M","","da-DK")```` Which output format is: august I would like to add the ...
1
vote
1answer
137 views

SQL query to group EventDates by day of week

I'm trying to write a query in Marketing Cloud that will filter for an event (specifically a unique open) that took place on a specific day of the week. So for example, my query would answer the ...
-3
votes
1answer
45 views

Contract End Date Formula

I've been racking my brain for about 8 hours trying to figure out how this formula works, or I guess WHY it works. DATE( Year( Contract_Start_Date__c )+floor((MONTH(Contract_Start_Date__c) + ...
1
vote
2answers
45 views

How to assign current date to a custom field in a apex controller

transact.Transaction_Date__c=Date.Today(); Above is my code. Why am i getting yesterdays date?
0
votes
0answers
53 views

Record Edit Form set Date inputfield value

I'm attempting to set the value of a Date input field with this value: '2019-8-25'. It's populating in the UI, but when I try to submit the form it's showing I'm setting it like so: let date = new ...
0
votes
0answers
189 views

“INVALID_TYPE_ON_FIELD_IN_RECORD” while updating date/dateTime field using SOAP client

I have a SOAP client which connects with Salesforce and do CRUD operations. Earlier I used to use Axis to generate stub and in that case it works perfectly but then I replaced axis with force-wsc due ...
0
votes
3answers
196 views

SOQL with Date filter in WHERE clause [duplicate]

@AuraEnabled public static List<StaffReport__c> getUserReports(String UserId, Date startDate, Date endDate) { return [Select Date__c from StaffReport__c where User__c =: UserId AND Date__c &...
5
votes
2answers
234 views

DateTime.addMonths skips a month (from feb to mar)

I'm writing some code to get each months name between a start and an end date. This works fine for most months - except February into march, and november - december. Heres the code : Date startDate ...
0
votes
1answer
36 views

Missing date operators in the entry criteria

I am creating a Salesfore Data entry source in a Journey. In the second step 'Entry Criteria' I have to apply a filter based on a date field 'XXX is greater than 'Today' plus 4 days' That ...
0
votes
1answer
29 views

Date Formula field help

Good Day, Would like to request assistance on a formula. I am trying to capture the Day & Month of a field called Contract_Start_Date__c and then add the year today. For instance Contract Start ...
2
votes
1answer
134 views

How to retrieve the correct Account records from SOQL query?

In account record I have a custom myDate__c field of type date. I need to retrieve all Account records where myDate__c is older than 45 days. I've tried with the following query: SELECT id, name ...
1
vote
3answers
201 views

Is DateWithin30Days(Date 1, Date 2) an Apex Method?

I'm working on the #APEX Unit Testing unit on #TrailHead, and I saw what appears to be a very useful Date method, DateWithin30Days(date1, date2) This would be very useful for some of my projects, but ...
0
votes
1answer
68 views

How to override user's locale for toStartOfWeek() method, so that system should always return Sunday date as week start date?

Date currentDate = System.today(); System.debug('Start of week = '+currentDate.toStartOfWeek()); For English (United States) locale System.debug will display Sunday date as Start of week. And for ...
0
votes
1answer
47 views

String parse to Date yymmdd

I wrote a question below : String parse to Date yyyymmdd But now I'm facing a new similar question : What if I want to parse a string yymmdd to a date? for example : 190503 instead of 20190503. ...
7
votes
1answer
90 views

Set collection doesn't always enforce uniqueness with the Date datatype? Does the following example seem correct?

Consider the following unit test: @istest public static void datetests2() { Set<Date> dts = new Set<Date>(); dts.add(DateTime.now().Date()); dts.add(DateTime.now().addHours(1)....
0
votes
1answer
154 views

String parse to Date yyyymmdd

I need to parse a string that I got from a json to date while the value of the string is in the next format: yyyymmdd - for example 20190429. Is there another simple way to do it instead doing ...
0
votes
1answer
83 views

Same Date, self reference? Work-around ideas

I have got a lot of research and recherche done as this simple where clause doesn't work because of it self-reference. I want to display all leads and opportunities who have the same "datefield x" as ...
0
votes
1answer
77 views

Business Hours calculation is incorrect/ not consistent for certain dates

My use case is to calculate the deadline to respond on the Case. Rule is to add 10 business days from the complaint received date. Defined the business hours: Logic 1 Date initialDate = ...
0
votes
1answer
255 views

Apex Date Parse Invalid Date in IE11 - Valid In Chrome

I have a string searchStartDate coming from an input field on a VF page. The input is 03/20/2019 Once passed to the apex controller I debug the string before parsing it. In IE11: 08:02:13:041 ...
0
votes
1answer
250 views

<lightning:input type=“date” validation

I need to put a validation on lightning input field date. It is a date of birth field and it should not accept date beyond system.today(). Basically the validation will be date_Of_birth > Today() , ...
0
votes
1answer
63 views

Issue with apex:input datetime

I have a page where a patient enters the appointment date for consulting, I m showing a dateTime input fields as <apex:input type="datetime-local" value="{!appointmentDate1}" styleClass="bRadius ...
0
votes
1answer
54 views

What is wrong with my Date/time Process Builder Formula based on a Date field without weekends

I have a Task Process Builder based on Opportunity Stages. I am trying to create a formula for the date time due field based on a date field (Internal Deadline). I need the formula for the Date Time ...
0
votes
1answer
153 views

How to send date from web to lead to datefield salesforce

I try to pass a date from a web2lead form to a date field, but the field stays empty. Travel date in: <span class="dateInput dateOnlyInput"> <input id="00N1t00000K2yXV" name="...
0
votes
1answer
61 views

Converting a String to a Date with Date Format YYYYMM

I kind of stuck on this one. Basically, we have a string that is actually a date with a format YYYYMM. For example, 201901. I wanted to convert this into a date record, but I found out that we could ...
-1
votes
1answer
24 views

Show Date selected in Filter in separate text boxes [closed]

There is requirement to show Date range selected in seperate text boxes. For example if i have a Select list filter for Dates and i have selected date range between 01/01/2019 and 12/01/2019, i also ...
0
votes
1answer
155 views

How to separate The Day, Month and Year attributes using SQL _Open query in salesforce marketing cloud?

I have creating TestDE Data extension using these attributes like SubscriberKey, AccountID, EventDate, Date, Month, Year attributes. And Created with same attributes using Target Data extension. Now ...
0
votes
1answer
534 views

Apex convert string mm/dd/yyyy hh:mm:ss to standard system date (yyyy-mm-dd 00:00:00)

I am trying to convert string from google docs "1/16/2019 11:52:38" to standard system date "2019-01-16 00:00:00". I was able to achieve that using substring method but I am pretty sure there is a ...
0
votes
1answer
76 views

How to add only business days

I have a problem with adding days when creating Task. I have a simple apex code newTask.ActivityDate = Date.today().addDays(5); But what i need to do is to count only business days. Thanks for any ...
0
votes
2answers
303 views

Convert String Date to Date in Apex

I am using an SOQL in a webservice that is querying the Contact object based on the BirthDate field. The webservice request has the date in the format of 'yyyy-MM-dd',i.e.,1962-01-29 as an example. I ...
0
votes
1answer
27 views

How to display Date time field without showing the 00:00:00 Time when we reference it in the Apex code?

We have a S-control button which sys SendAttendancelist. The S-control calls the apex class Classobj in that we have a email that is sent out from apex while executing it sends out email with few ...
0
votes
1answer
397 views

String ('yyyy-MM-dd') to date using date.parse returns ('yyyy-MM-dd hh:MM:ss')

I am trying to output a date type with the format yyyy-MM-dd, but. not as a string type. I can create the string just fine. // First I output 2018-12-01 00:00:00 as a date currentDate = Date.today()....