Questions tagged [datetime]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
37 views

why this Datetime works like this?

I have 2 datetimes with fixed values: 2020-09-12T18:13:41Z <lightning:input aura:id="stst" type="datetime" name="input3" label="{!$Label.c.Start_Date_Time}" required="true" value="2020-09-12T18:...
0
votes
2answers
31 views

How to get a list Size on a Map key without iteration

I try to write a trigger that set case status to "Closed" if thereare more than 2 cases created that same day (today) associated with the same contact. The problem is I don't want to use SOQL queries ...
0
votes
1answer
23 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
1answer
21 views

Date Time GMT Format

I know there a lot of answers on the web about this issue. I don't know why or what I do wrong, I cant achieve my need. I'm getting a dateTime from a web service (Guest user) in this format : 05/...
0
votes
1answer
23 views

Retrieve Records added into a Data Extension on the last hour using SSJS

I have a Filtered Data Extension "Audience Segmentation - Python Developers" with the following fields: - SubscriberKey - Name - ProgrammaticLanguage - DateAdded (default value: Current Date) I ...
0
votes
1answer
20 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); }
2
votes
1answer
17 views

Is there any chance to get the differnce between users timezone and GMT+0?

I know, how to get my timezone: TimeZone tz = UserInfo.getTimeZone(); And I know, how to get current time of my timezone: Datetime now = Datetime.now(); Integer offset = UserInfo.getTimezone()....
0
votes
1answer
43 views

How to add 24 Hours to a date/time field?Can anyone help?

I am working on developing a validation rule, where a particular date time field should not be greater than 24 Hours from the Created Date time.
0
votes
2answers
66 views

Modify DateTime Object In LWC (Javascript)

tl;dr - How do I access and modify the properties of a DateTime object in LWC? I'm trying to create code that will populate an HTML field with the current date-time, adn the current date-time plus 30 ...
0
votes
0answers
33 views

NOW() formula not working as expected

I have a process builder that contains the NOW() formula for whenever a particular action is completed. I am running into the issue of it populating the date/time as the day before at 6:00pm. Would ...
0
votes
1answer
25 views

DateTime Format Outputting Wrong Time

I am currently building an external web application using MVC. I need to format the DateTime to match Salesforce's format so I can push it up via API endpoints. The DateTime picker in my View works ...
0
votes
1answer
28 views

How to trim out “Date” from Date/Time field in Salesforce?

I have a Date/Time field (call it Field A) that gets populated by an external system, i'd like to create another field that trims/extracts the Time value from Field A. I want to do this to use a ...
0
votes
1answer
24 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
1answer
32 views

Apex format function returning weird dates

I am attaching a screenshot which shows a code sample and it's output also. When I normally debug the created date it shows me correct output and then when I try to format it using format function it ...
0
votes
1answer
36 views

The issue in DateTime Field while saving from lightning component

I'm facing the issue in the Datetiem field type in the lightning component. I'm using for input and call apex method to save the fields for one of my events. Requirement: Save the 2 DateTime field ...
0
votes
1answer
71 views

How to convert UTC to IST conversion in apex?

I am getting the time as string like "client_modified": "2020-02-04T11:27:34Z" How can I convert this to local time zone, Update: I am getting this time from api response I need to display it in ...
0
votes
0answers
23 views

Date Time field - how to get field value without adjustment?

I want to get a date and time that a user has input into salesforce, as they have input it, using apex. At the moment, if they input a time for a date after clocks go forward, it seems to be saved ...
3
votes
1answer
152 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 ...
1
vote
0answers
21 views

OutArguments to be used in journey builder (Decision box)

My CustomActivity (type- REST) returns an outArgument which is of DataType - DATE. I have configured the outArgument correctly and it is visible in the following widgets. MY customActivity is followed ...
1
vote
1answer
20 views

Datetime Value Issue during time conversion

I have executed following code on developer console and it shows incorrect hour. Since the time used is from Seattle (Pacific time) which is 8 hours behind GMT. So when datetime.hourGMT() is used ...
0
votes
0answers
33 views

Display seconds in formula using date/time

How can seconds be displayed in a formula field that references a rollup summary field that calculates the MAX value of datetime field from the child objects? The rollup summary contains a datetime ...
0
votes
1answer
33 views

How to get week name(Week1, week2 , week3 , week4 ) or number from the month in apex function

I have a requirement to create a record on weekly basis after checking if record is not created for the previous week. how to get the week number for each month and if i am in week 2 of month than how ...
1
vote
1answer
46 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
16 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 ...
-2
votes
1answer
67 views

How to get the current month and use in batch apex query

I want to get the current month from picklist field and use that current month in soql query in a batch class. I have written the following code and its not working. String month = Product.Month__c....
1
vote
2answers
50 views

Need help to convert the date time into EST in apex class

I have googled it but no proper solution I found it in any salesforce community. Scenario is we are making a callout and getting the response as string value like "2018-06-12T19:00:00-07:00". Now ...
1
vote
1answer
80 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
25 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:...
0
votes
0answers
36 views

Time calculation in apex

My requirement is to assign records if the lastmodifiedDate of the record falls within the employee availability. For example let's say on Sunday employee available between 8.00 AM to 5.00 PM and if ...
3
votes
1answer
52 views

Datetime.newInstance and Datetime.newInstanceGmt are not working correctly

My user's timezone is GMT+2 (Eastern European Time) and I notice strange thing when playing around with dates. Date myDate = Date.newInstance(2019, 11, 29); Time myTime = Time.newInstance(9,0,0,0); ...
0
votes
1answer
22 views

Return of Datetime value

I am new to Apex. I have instantiated the Datetime field with (2019, 12, 31, 12, 12, 12) where hour/minute/sec all are '12'. but in the output it is returning '20:12:12'. Please help me to ...
0
votes
1answer
14 views

Updating datetime field from Visualforce remoteObjects

I m trying to update a datetime field from VF page using remoteObjets and I am getting this error: err: Error: Last Viewed Timestamp: value not of required type: 2019-11-20T11:00:56.373Z This ...
0
votes
1answer
25 views

DateTime.ValueOf(myString) returns date completely wrong

I'm not sure why this is happening. When I run System.Debug(DateTime.valueOf('2019-14-11 10:55:46 pm')); in Execute Anonymous I'm expecting it to return the same date but in a DateTime. However,...
1
vote
1answer
27 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
1answer
43 views

What is the correct approach to create an Event in Apex for another User with their Timezone?

I'm trying to create an event for another user which needs to appear on their Calendar (in that user's Timezone). e.g. Current user's Timezone is Australia/Sydney, I need to create an event for a New ...
0
votes
2answers
201 views

Having trouble getting DateTime Property in LWC [closed]

Trying to do a simple LWC that displays relevant fields at the top of an opportunity. But one of the fields is a DateTime field and is giving me some significant problems. When I check in the console, ...
0
votes
1answer
86 views

SOQL Difference Between two datetime columns

I'm trying to find all records that have a difference of 5 years between two of their columns. A mysql example of this would be SELECT ... FROM custom_object__c where mydatabase_ID__c > 1 and ...
2
votes
1answer
79 views

Datetime conversion from date vs explicit midnight

I've just spent two days banging my head against the Salesforce wall, and the problem came down to this: Date wkStart = Date.newInstance(2019,10,12); Datetime wkStart1 = wkStart; Datetime wkStart2 = ...
0
votes
0answers
36 views

Event startDateTime shows more timestamp on Production

I have assigned custom timestamp to "starDateTime" standard field of event object by concatenating to custom date field but it shows additional 5:30 hours on Production.It works better in sandbox. I ...
2
votes
1answer
237 views

How to correctly convert Unix Timestamp with timezone offset into Apex Datetime?

There is a webservice which I'm trying to integrate in Salesforce. The webservice returns a date time in format like this /Date(1569301200000-0500)/ I believe this is Unix Timestamp, and we can ...
2
votes
1answer
37 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
67 views

Formatting Dates and Time for SMS using AMPScript in Content Builder

Having a format issue on a SMS in Content Builder. Can someone point me to the correct code for this? Also would love some advice to learn basic AMPScript coding. Books? Tutorials? Online classes? ...
3
votes
1answer
90 views

How to convert String to DateTime without time zone conversion?

I have a requirement to convert string value to DateTime without converting it to time zone. Ex: Datetime today = Datetime.now(); String myDate = today.format('yyyy-MM-dd HH:mm:ss'); Datetime ...
-3
votes
1answer
52 views

Get number of milliseconds since January 1, 1970, 00:00:00 UTC in apex [closed]

I want the apex equivalent of the following javascript method : var utcDate3 = Date.UTC(2019, 7, 19, 18, 20, 5); Because I need the number of milliseconds in the given Date object since January 1, ...
0
votes
0answers
39 views

Get LanguageLocaleKey based on timezone ID

I have a custom object called Machine__c and i have a custom picklist field in it called Time_Zone__c. This Time_Zone__c field has the same picklist values as the Standard User object timezone field. ...
0
votes
0answers
45 views

Converting String to Date

I have date format which is returned from JSON which i get in String, how do I convert it to Salesforce date format ? Does anyone have knowledge which date format is this ? Following is the date ...
0
votes
1answer
48 views

APEX test script to web server with a static time stamp doget cakk and HttpGet

New to writing test scripts. Looking for help in error in Unexpected token 'Lead' for my test code. I have a static field that pulls off time stamp to only pull data after a certain time. I am ...
0
votes
0answers
105 views

SQL to post + 30 days by Date/Time attribute

Goal is to find rows where the date is exactly 30 days from today. Source is a Salesforce Date/Time field from a Synchronised Data Extension and posted to a regular Data Extension to Date attribute. ...
0
votes
1answer
78 views

Invalid Date Time

While trying to retrieve the headers from an integration response, I am getting a Datetime value in String format in the Header. Format - Mon, 01 Jul 2019 10:20:06 GMT I need to compare this with the ...
0
votes
1answer
48 views

Is there a way to detect actual user time zone (not Salesforce user acc.) in visualforce?

We have a "guest" form on our site, and a "guest" user to authenticate. Since the user has a set time zone, this is what (by default) is used by visualforce. Problem is, our Guest User will always be ...

1
2 3 4 5
12