Skip to main content

Questions tagged [datetime]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 views

Business Hour Time zone should we have to change in every day light savings time

If timezone is changed in "Company Information" for a Salesforce Org (Org-Wide Time zone) in a particular Day Light Savings Time(Suppose November 3, 2024), then a particular Business Hour ...
vinesM's user avatar
  • 1
1 vote
1 answer
68 views

My APEX codes are returning wrong datetime?

Can anyone help me? Seems like the following line of APEX codes are returning wrong time? I am in Malaysia timezone & the login user who is executing these line of codes is in Sydney timezone. The ...
herethere's user avatar
0 votes
1 answer
49 views

Converting Epoch time to DateTime in Salesforce Apex

I have created a REST API in Salesforce to create cases. I am getting POST request from user like this: { "Origin": "Call" "LastSeenTime" : "1.713974587E9&...
वरुण's user avatar
1 vote
1 answer
70 views

How to determine start of week for a given locale in Apex

My biggest complaint about SF is there are some many places where functionality is wired to the current User's identity when I have to do something in Apex on behalf of a user other than the currently-...
Ken's user avatar
  • 430
1 vote
1 answer
411 views

Format Date field to pass to OmniScript

I am using Apex to retrieve 2 Date fields from the FundingOpportunity object and I want to pass them back to my OmniScript via Integration Procedure. However the issue I'm running into is they are ...
stormy's user avatar
  • 51
0 votes
0 answers
54 views

Datetimevalue function adding an hour

I’m using the Datetimevalue function in a formula field to convert a date value to a date time and it’s saving on the record as 00:00 GMT as expected, however when viewing it it is converting to 01:00 ...
Jonathan's user avatar
0 votes
0 answers
46 views

SQL Query to update DE field when "x" hours away from date/time field which is already formatted to the correct timezone

We are working on building a journey that is extremely dependent on utilizing a date/time field (StartDateTime) to determine when emails/sms are delivered. Given the constraints in Journey Builder ...
Spencer Bard's user avatar
1 vote
0 answers
113 views

Apex, how to formatting Datetime in appropriate language

Once again I'm flabbergasted and disappointed in SF and Apex functionality. Either that or I missed something. It appears that Datetime.format() doesn't return the result in the running user's ...
Ken's user avatar
  • 430
0 votes
1 answer
47 views

How do we change default drop down values in Date Time field for Time drop down?

I have a Date Time field, in Time Drop down the values display as 12.00 am, 12.15 am, 12.30 am and so on, but i need only to show interval with 1 hr, like 12 am, 1 am, 2 am and so on. Please help on ...
Harikrishna Parvatam's user avatar
-1 votes
1 answer
84 views

How to create a sql query in SFMC with where clause with date and time

I am trying to create a query that pulls the record from _open data view before a specific date and time, how to do that in sql? I am currently doing this for defining the date: Select * from _open ...
kl2's user avatar
  • 353
0 votes
1 answer
292 views

Calculate hours between 2 date/time fields excluding weekends adapted for different timezones

I am stuck with an issue with editing Salesforce formula for counting business hours between 2 dates (provided by Salesforce here): ROUND( 8 * ( ( 5 * FLOOR( ( DATEVALUE( date/time_1 ) - DATE( 1900,...
Ivan Sholok's user avatar
0 votes
0 answers
346 views

ReferenceError: Datetime is not defined

I'm trying to convert current time in hours and getting an error called DateTime not defined help from Anyone? import { LightningElement,api, track,wire } from 'lwc'; import { NavigationMixin } from '...
Raghu's user avatar
  • 39
0 votes
1 answer
1k views

LWC - How to set current time when having date already? (Converting Date to DateTime)

I need to convert a Date to DateTime and display the value in LWC. I would like to calculate this on LWC's side not Apex. I already got the logic and calculated for Date. Now I want to append the time ...
Pam's user avatar
  • 107
0 votes
2 answers
56 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
135 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
324 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
720 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
255 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
204 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
  • 353
0 votes
1 answer
88 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
  • 21
0 votes
1 answer
237 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
2k 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
107 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
231 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
866 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
897 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
262 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
317 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
173 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
175 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
173 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
328 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
  • 136k
0 votes
1 answer
92 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
-1 votes
1 answer
307 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
92 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
1 answer
128 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
87 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
599 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
93 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
105 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
217 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
112 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
5k 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
100 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
314 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
1k 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
  • 512
-1 votes
1 answer
499 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
-1 votes
1 answer
726 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
148 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

1
2 3 4 5
15