Questions tagged [datetime]

A value that indicates a particular day and time, such as a timestamp.

Filter by
Sorted by
Tagged with
-3 votes
0 answers
69 views

Apex and LWC don't agree on Date being passed

The LWC is calling an APEX method that returns a list of Asset objects. It's returning a Date field. Here's what debug shows for two records: Record 1: "Close_End_Date__c":"2023-11-03&...
JRob's user avatar
  • 1
0 votes
2 answers
45 views

Unable to convert a particular string format to DateTime

I have the following dateTime values 2023-11-05 09:16:14 2023-11-07 09:16:14 Im getting them properly from a table using Apex code DateTime startDt = informaticaAuditTableRecords[0].startDate; ...
amitsingh6651's user avatar
-1 votes
1 answer
53 views

Convert epoch into datetime in CloudPage

I have a CloudPage JS Resource that I use to parse a JSON. As part of the JSON, a UTC timestamp in milliseconds is provided. I want to convert that into a DateTime and save it in a DE. I've tried ...
Alex's user avatar
  • 158
-2 votes
1 answer
72 views

update date time field for last case comment on case

In a record triggered flow, how do I update a date time field on the case called Date/time Last Comment when a new case comment is made?
Dov's user avatar
  • 1
-2 votes
1 answer
94 views

Salesforce - How to compare two Date/Time fields?

Good afternoon! I am working on a formula field that will compare two DATE/TIME fields and return the larger of the two dates. My current formula is drafted below, but so far, the field I am trying to ...
Conner Brown's user avatar
-1 votes
1 answer
52 views

Time Elapse Two Datetimes in Hours

I am trying to find time elapsed between two datetimes in hours. Below code attempted by me. Example: A record is saved and after 2 days we have to calculate the elapsed time in hours i.e. Number of ...
Deeksha Gaur's user avatar
0 votes
0 answers
106 views

How to check if a today's date is between two dates using AMPScript in SFMC?

Background: On a cloud page in SFMC, I am trying to display a message if today's date is between start and end dates that are coming from data extension. Question: How can I perform a check and see if ...
kl2's user avatar
  • 317
0 votes
1 answer
67 views

put(field, value) method from SObject class throws System.SObjectException: Illegal assignment from String to Datetime

I have encountered the error System.SObjectException: Illegal assignment from String to Datetime and I can't find what is the reason for this error. The context is as follows. I have a class with the @...
Tzinm's user avatar
  • 1
0 votes
1 answer
73 views

Convert or parse datetime coming from external system and save it in salesforce [duplicate]

I am calling a rest api and one of the attribute of the response is datetime which is in CST format(6/26/2023 7:01:50 AM). I tried converting to date time format but its throwing Invalid date/time: 6/...
Sancool's user avatar
  • 43
-2 votes
1 answer
338 views

How to work with different time zone in Salesforce Apex

Lets Say i have a location Object which stores multiple location details. In location object we have fields : TimeZone - Field 1 Opening Time - Field 2 Closing Time - Field 3 My Salesforce org ...
Mudit Yadav's user avatar
0 votes
1 answer
74 views

I have a req to show different date time values based on different condition. One to display time in ISO, then in full date along with time & zone

I want to display time in 3 different formats, along side follow the translation strategy as well. That is if user selects to translate the page, user should be able to see the date in his/her local ...
SF Learner's user avatar
-1 votes
1 answer
63 views

Formula to display time difference in minutes between 2 fields while excluding weekends

I'm facing an issue with a formula, and I could use some support. I have a requirement to calculate the time difference in minutes between two datetime fields, Email_First_Reply_Date_Time__c and ...
Carmen Groza's user avatar
-1 votes
2 answers
141 views

Formula to Calculate 5 working days from created date, where created date is DateTime data type

I found a formula online about returning a date data type for 5 working days after the case created date, but I noticed the "created date" data type is set in DateTime. I am thrown through a ...
Jasmine G's user avatar
1 vote
1 answer
293 views

DateTime is reverting to UTC before the actual datetime in LWC lightning-input type="datetime" field

Whenever I clear the time value, the datetime field shows the value with one day before the datetime that was orginally present. After clearing the value, when I add the value again, the event.detail....
SFDC Learner's user avatar
0 votes
1 answer
84 views

lightning-input type="datetime" does not hold the time value at first time in the UI

When I select the time first in the date time field it does not hold the value and when I do the same again and select the time first it holds it. Below is my code : JS : @api endDateTime = null; ...
SFDC Learner's user avatar
0 votes
1 answer
88 views

How to Query records from an object in Salesforce, which are created today and before a specific time

I need help in designing a SOQL QUERY. Scenario is: Every day 10 pm my batch class will run (Its a scheduled one) and in the batch class i have a query to fetch all the orders which are stuck at '...
Archita Patnaik's user avatar
0 votes
0 answers
45 views

onChange event is not fired for lightning:input type="datetime" when clear Time field in LWC [duplicate]

I have an lwc lightning-input datetime field and a custom validation. It does not work when the I clear the time value out of it. This is similar to what's mentioned in this link. However, I am ...
SFDC Learner's user avatar
0 votes
0 answers
28 views

Novice Salesforce User - How can I create a time stamp in a field when another field is filled in

I have a salesforce (QUIP) spreadsheet that people fill out when someone checks in. There are 5 fields. The first one is their Amazon log in(A2-A200). I want the last field that I created (G1-G200) to ...
Christian Johnson's user avatar
0 votes
0 answers
90 views

DATETIME Field value doesn't show in Lightning-Record-Edit-Form

I have a problem with visability of Date/Time values in Lightning-record-edit-form. This is my code: <lightning-record-edit-form object-api-name="Event_Calendar__c" onsuccess={...
Anyja's user avatar
  • 1
-1 votes
1 answer
101 views

Is DATEVALUE() not supported in formula fields to be referred in Rollup summary field filter

I have a formula field which references MONTH(DATEVALUE(CreatedDate)), but due to some reason this formula field is not visible in roll up summary field filter and I can't figure out the potential ...
Isha's user avatar
  • 163
-1 votes
1 answer
56 views

SQL filter on Date doesn't work

In my Data Extension I have a column named 'CreatedDate'. This is formatted like this: Wednesday, May 03, 2023 9:20 AM In my automation I want to select only records since 01/01/2023. Time parameter ...
Frederik's user avatar
4 votes
1 answer
226 views

Is this a bug in Apex DateTime.format?

I have a failing test that I've narrowed down to the DateFormatTest.d31 case below. The test results are: TEST NAME OUTCOME MESSAGE ...
Keith C's user avatar
  • 135k
0 votes
1 answer
47 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 ...
greeshma.e's user avatar
0 votes
0 answers
31 views

Extract 'date sent' from email sent in Outlook and copied to the lead record

We need to track first contact date/time and it's copied back to Salesforce from the Outlook connector and it's sent in Outlook. I can see the date/time copied across, but it's not part of activities ...
gato negro's user avatar
-1 votes
1 answer
119 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 ...
Joseph's user avatar
  • 1
0 votes
0 answers
63 views

Stop datetime from autofilling time to 12:00

In lightning if you choose date first the time will autofill to 12:00. Is there anyway to stop this? Our users should specify time, but routine takes over after some time and almost every datetime is ...
Kacper A's user avatar
0 votes
0 answers
24 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 ...
Pejoham's user avatar
0 votes
1 answer
99 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(...
potato46's user avatar
-1 votes
1 answer
51 views

Formula field not working - Error: Incorrect parameter type for operator '-'. Expected Number, DateTime, received Date

I wrote the following formula to calculate number of hours (monday-friday 9am to 5pm) between two dates: ( 5 * ( FLOOR(( Closed__c - Opened__c ) / 7) + MIN(1, MOD( Closed__c - Opened__c, 7 ))...
Marjan's user avatar
  • 15
-1 votes
1 answer
409 views

Display Created Date DateTime field as DD/MM/YYYY, HH:MM:SS (am/pm) in record detail page

I've been trying to figure out how to display Created Date field with the format: DD/MM/YYYY, HH:MM:SS [AM/PM] By default, Salesforce displays it as DD/MM/YYYY, HH:MM [AM/PM]. See picture below. I'm ...
Dabidee's user avatar
0 votes
0 answers
68 views

Formula field displays incorrect value

I want to calculate total number of working hours (Mon-Fri 9am-5pm) between two date/time fields. I have written the formula below: ROUND(8 * ( (5 * FLOOR((DATEVALUE( Closed__c ) -DATE(1996,01,01))/7) ...
Marjan's user avatar
  • 15
1 vote
1 answer
79 views

How to replace time part of DATETIME input by value from TIME input

I've tried to find an algorithm (Salesforce, aura) but without success. Probably, you have any ideas! I have: attribute <aura:attribute name="bulkApply" type="Map" default=...
Daniel Velesevich's user avatar
0 votes
2 answers
150 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 ...
Scott Lam's user avatar
-1 votes
1 answer
75 views

Date/time field is not populating although syntax is working

I would like to combine a date and a time value, based on the condition, that the "time of the day" field is set to "Morning (09:00 - 13:00)". The syntax is working but when I look ...
Daniela's user avatar
0 votes
1 answer
3k views

Lightning Formatted Date Time converts datetime to system settings timezone

I have a lightning formatted date time which has a value of a datetime in Zulu format. And the value changes based on the computer's time zone. For example, I have 2023-01-10T20:00:00.000Z, and it is ...
Rwwwwwr's user avatar
  • 15
0 votes
0 answers
63 views

Time in Case Custom Field Value - conditional on case status

The business has a field that captures an operational process (Investigation, Quote, in build, UAT etc) call this 'Ops Stage' and the core status of a case (in progress, waiting for customer etc). ...
Scott's user avatar
  • 1
0 votes
1 answer
211 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) --> ...
SFDC buddy's user avatar
-1 votes
1 answer
253 views

CreatedDate = LAST_N_MONTHS:3 vs CreatedDate >= LAST_N_MONTHS:3

This might be a silly question... but I'm trying to get the records created within the last 3 months. I have a custom object and I have the following two queries below. I see that the results are very ...
jojopogi's user avatar
  • 484
-1 votes
1 answer
368 views

Not able to change date format using SQL date function FORMAT(DateColumn,''yyyy-MM-ddTHH:mm:ssZ')

I am using below SQL query and want to change date format from marketing cloud Date format i.e. "Monday, May 13, 2019 12:00 AM" to "yyyy-MM-ddTHH:mm:ssZ" I have Used SQL Query , ...
JNC's user avatar
  • 39
0 votes
0 answers
122 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": [ { ...
SFDC buddy's user avatar
-1 votes
1 answer
436 views

today Datetime as default in lightning-input type="datetime"

Hello everybody I amd trying to get today's datetime in tha next field: The problem is that I am not getting the HH:mm I have the next .js code: dateval; get dateValue(){ if(this.dateval == ...
user avatar
0 votes
1 answer
83 views

ReplaceAll does not function Apex

Hello everybody I am managing data from a LWC form where the user inputs some data and I pass it to validate into an apex class. This validation manages the format of a date time value: I want the ...
user avatar
0 votes
1 answer
186 views

How to make an empty DateTime field in an update trigger?

I want my DateTime field (Due_Date__c) in the custom object to be empty once I update the record. However, it's not changing to null when I update the record. public class TestObject2Class { public ...
TheRipper's user avatar
1 vote
1 answer
426 views

How do I change date/time format on object? To 24 hour clock

Every objects I have, the date/time format is in 24 hour clock. So why is there this object with am/pm? How do I change it to 24 hour clock format? The weird thing is that when I edit the field. It is ...
Rasmus's user avatar
  • 13
0 votes
0 answers
195 views

Can you allow users to select a specific timezone on a date / time field?

We have a scenario where we want to allow a user (who works in EST) to be able to select a date / time for a specific timezone. Our users submit orders for customers across multiple time zones and are ...
user124216's user avatar
0 votes
0 answers
458 views

Datetime.valueof auto convert to UTC (GTM+0) when store in DB salesforce

Today I face with problem about date time in apex. Value of date time from response api is: 2022-07-29T02:21:34.000Z But after I use Datetime.valueOf like below Datetime newDateTime = Datetime....
Richard's user avatar
  • 33
0 votes
2 answers
4k views

Formula for calculating number of hours between 2 Date/Time fields

Problem: I am trying to figure out the time in hours it takes for a Lead to be contacted after the Lead record is created Steps Taken: 1- Created a custom read-only Date/Time field called ...
NoviceAdmin80's user avatar
-2 votes
1 answer
263 views

How to remove seconds from LastModifiedDate in flow in Salesforce [duplicate]

I am doing it in Record triggered flow and Trying to compare createddate and lastmodifieddate. when both are equal I'll update the record. Since createddate and lastmodifieddate are standard field so ...
user avatar
-1 votes
2 answers
2k views

How to change the format of createddate and lastmodified date in flow salesforce

How should I change the format of date from 2022-10-18T12:53:52.000+0000 to 10/18/2022, 6:23 PM in flow salesforce.
user avatar
-1 votes
2 answers
422 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 ...
SFGest's user avatar
  • 1

1
2 3 4 5
15