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

learn more… | top users | synonyms

3
votes
3answers
55 views

Formula works on page layout, but displays #Error! on Report

I have an issue. I have a text field to store survey completion date and time. I created a formula field to capture date only. DATEVALUE( completion_time__c) It is showing correct date on Page ...
0
votes
1answer
33 views

Unable to calculate days in apex

I need to calculate days between two fields. So I use daysBetween to complete when I try to do with two dates. When I try with single values. But, when I try with list it throws an error like: ...
0
votes
1answer
31 views

Computations inside of an IF() Function

I was trying to add some arithmetic inside of an IF function for a custom formula field and it didn't appear to like the syntax... IF(AND(ISPICKVAL( Status,'In Progress'),ISPICKVAL( Priority ,'...
0
votes
1answer
47 views

Process Builder - Add Minutes,Hours to Event End Date

I want to make the Event End Date as NOW()+60 Mins in process builder while creating a new Event record. But It is adding 60 DAYS even though Event End date is date/time field. How do I add minutes ...
0
votes
2answers
21 views

How to use “hours” apex:inputField type of time

Is that possible to use only hours? below code I can have hours and minutes but I just need hours to display, is there any attribute that needs to set? Visualforce page: <apex:page controller="...
0
votes
3answers
22 views

Week number calculation is not correct

I need to calculate week number from date. I use this method: DateTime.newInstance(year, month, day).format('w') But this returns week number 1 for 1 Jan 2016. In fact this date belongs to week ...
2
votes
2answers
43 views

Formatting Date with outputField

Apparently if I want to format a date to my own format ie. 1 June 2016 10:44 am I can only do this with outputText but output text does not respect the users time zone so everything is GMT. If I use ...
1
vote
2answers
30 views

Need date time formatting help

This code record.Start_Time__c.time() is giving me 11:30:00.000Z but I just want 11:30am or pm or army time might be ok too. This code currStartDate.Date() is giving me 2015-07-08 00:00:00 but I just ...
1
vote
2answers
31 views

Why is this formula returning 5H and 60M instead of 5H 0M?

Here is the source formula. IF( Step_1_Diff__c> 0 , TEXT( FLOOR(MOD(Step_1_Diff__c* 24, 24)) ) & "H " & TEXT( ROUND(MOD(Step_1_Diff__c* 24 * 60, 60), 0) ...
1
vote
1answer
43 views

Bug in Salesforce Day calculation for a date if hours is 0?

Does Salesforce have a bug in the day calculation logic if the hours is 00? May 9th 2016 is a Monday. But Salesforce always returns Sunday. I guess when the hours is 00:00, its considering it as ...
0
votes
1answer
21 views

Need to find whether my time stamp is between the business hours

I am trying to implement SLA for Lead management. So handling all the SLA functionalities on a trigger and Apex class. I need help in getting the current time and comparing it to the defined ...
0
votes
0answers
28 views

Date being returned as sudo Date time (shows actual time value) in class but as date (with 00:00:00) in dev console

Ok, so I have this code that is supposed to return only the date of a date time. When executing the code in dev console the proper date is returned however when calling a method with the same code, ...
3
votes
2answers
68 views

Datetime format conversion in apex

I have an input field in my visualforce page which uses the html 5 input element as type="datetime-local". The value that I capture from the field is of the format 2016-04-09T23:58 . I want to use and ...
9
votes
1answer
210 views

DateTime.day() returning inconsistent value when created from system.today()

This came up on twitter from @britishboyindc: Why does this return 'Wed'? Date myDt = system.today(); DateTime myDtTime = (DateTime) myDt; system.debug(myDtTime.format('E')); For a user with ...
1
vote
1answer
78 views

Attempting to Insert CreatedDate - Field is not writeable: Account.CreatedDate

I am trying to insert a list of records with a CreatedDate of my choosing. I read the documentation about what settings are needed to grant access to insert values for the audit fields. I have ...
1
vote
0answers
69 views

Invalid date/time error

Following piece of code is throwing an error: System.TypeException: Invalid date/time: 04/07/2016 02:00 PM if (t.activitydate != null) { DateTime activityDate = t.activitydate; ...
0
votes
1answer
31 views

covert string into date time format in field ledObj.Scheduled_Time__c= csvRecordData[10];

this value is in my csv 5/4/2016 15:00:00 and when i upload csv its not save into field. public class importDataFromCSVController { public Blob csvFileBody{get;set;} public string csvAsString{get;set;...
1
vote
1answer
296 views

Date Picker in Visualforce page using Lightning design system

I am trying to use date picker in ligtning design system and and using the idea explained in this link to do it: Lightning (SLDS) styling for calendar This works fine in the browser on the desktop ...
9
votes
1answer
323 views

JSON: Cannot deserialize instance of date from VALUE_STRING

I'm officially breaking up with Salesforce Date parsing. This has got to be the most frustrating thing. I have the following date in a JSON string (full JSON below): 2017-06-03T10:34:24.000Z ...
3
votes
2answers
148 views

How to set Date/Time in salesforce using javascript

I am updating the record in the javascript while clicking on custom button. I have custom date/time field Approved_Date__c. I need to update that fields also using javascript. How can I assign current ...
6
votes
2answers
239 views

DateTime.Format() Documentation example causes exception

I'm trying to get a DateTime to format into a value to be used in a dynamic query. For some reason, the documentation snippet on how to format a DateTime for a query is giving me an exception. Im ...
1
vote
3answers
56 views

difference between two date time fields in days

I have a datetime field field1 which i am populating using NOW() formula. At some point later i want to know the difference between NOW() and field1 in number of days. I tried NOW()-field1 and ...
0
votes
1answer
30 views

How to retrive time from standard look up field in opportunity

Hi i got a requirement like to get time in standard look up called CreatedBy in opportunity page. Is it possible to retrieve only time from that field. Because it is Look up relationship of user.I ...
0
votes
1answer
42 views

Task Activitydate in user timezone

Trying to convert DAteTime field in local user time zone with following code but get an error: Compile Error: Method does not exist or incorrect signature: [Date].format(String, String) ...
2
votes
1answer
60 views

Date toStartofWeek() On Sunday?

Here is my code: Date myDate = startTime.Date(); //e.g. myDate =2016-03-01 Date weekStartDate = myDate.toStartofWeek(); //weekStartDate results 2016-28-02 When myDate equals 2016-03-01 the ...
3
votes
1answer
26 views

How does Salesforce Calculates Fiscal Periods?

We have offices around the globe (from India to San Francisco). Now I am told, that our West coast users, get their date reset at midday. As weird as it sounds to me, I am interested to know: How ...
0
votes
1answer
22 views

Lead date-time to calendar

Can I update my calendar in Salesforce with a date and time stored in a Lead record automatically? Happy to write a class or trigger, just wondering where to start. Thanks.
1
vote
2answers
47 views

assertion error with timezone in unit test

I have a unit test that is passes when the user running the test is in the CST timezone, but in any other timezone, the unit test fails with the assertion error: Assertion Failed: Expected: 2014-05-19 ...
0
votes
0answers
69 views

Date/Time input field

I am using Date time field. <apex:inputField type="datetime" value="{!ss.startDT}"/> When I save or do some operation The format gets changed when value is selected When Page gets refreshed ...
5
votes
2answers
591 views

DataTime.format returns Feb 32 as a result

I am at Australia and the time now is 13:00 Feb 1. With the following code: DateTime thisTime = DateTime.now(); System.debug(thisTime); System.debug(thisTime.format('DD/MM/YYYY HH:mm')); For the ...
0
votes
1answer
52 views

Date/Time Field User Locale

What is the best way to create a date/time field which doesnot automatically change date/time according to logged-in user's timezone? For example, if User1 (PST) sets the value in a date/time field ...
0
votes
1answer
75 views

Unit testing code which has logic around last login date of user

I need to write unit testing code which has logic around system field last login date of user.As per spring'16 release salesforce has added method for setting created date like below. Test....
-1
votes
1answer
71 views

Custom Segment: People who joined the list in the past 30 Days or have opened an email in the past 90 days

I would like to create a query that allows me to build a data extension for a segment that has either entered our list in the past 30 days OR opened an email in the past 90 days. I have the Query for ...
1
vote
2answers
161 views

Date not formatting correctly

I am using the below code to format the LastmodifiedDate for records from the Note table public List<wNA> rowList {get; set;} public class wNA implements Comparable { // see http://...
2
votes
1answer
35 views

Getting the year from a Date custom field

I have a custom field whose data type is "Date". I would like to use this field in a formula editor. I want to get only the year value from the date field( field api name is pres_date__c). When I used ...
-1
votes
1answer
71 views

Query: Building a Group based on Date Email Added/Created

I'm looking to build a list segment based on people who joined my list in the past 30 days. However, when I try to check the syntax on the query below, ExactTarget gives me the following error message:...
3
votes
1answer
133 views

Apex: Date/DateTime.parse or valueOf string gets error

I've got a date string coming in like so: String str = 'Thu Jan 14 2016 23:29:58 GMT+1100 (AEDT)' It's always in that format, but neither Date nor DateTime can .parse or take .valueOf the string. ...
2
votes
1answer
59 views

Changing case owner based on created date with respect to organization time zone

In Apex, I would like to get the cases created in January 2016 based on organization time zone. E.g. Organization time zone is GMT+8 and a case record has been created in 31/12/15 23:00:00 GMT , Is ...
1
vote
1answer
66 views

Why week of year is wrong?

I'm using this code : Time t = Time.newInstance(12, 0, 0, 0); DateTime dt = DateTime.newInstance(Date.parse('22/02/2016'), t); system.debug(LoggingLevel.WARN, Integer.valueof(dt.Format('w'))); It ...
1
vote
1answer
22 views

DateTime conversion from string

I'm new to Salesforce development and not sure why when I read a database column as string my result in debug log is: 01/06/2016 10:09 AM while when i change it to DateTime it becomes: ...
3
votes
1answer
119 views

Wrong Date value when using formula DATEVALUE(DateTime)

I have two fields EVENT_DATE(type DateTime) and EDate(type Date). I am using a workflow to get Date value from EVENT_DATE and store it in EDate. Workflow formula :- DATEVALUE(EVENT_DATE). The workflow ...
0
votes
2answers
66 views

Issue with Salesforce Datetime formatGmt method

I have been experiencing a strange issue since Dec 27. When I try to format a date to a string, it is giving me next year date. When I executed this in Workbench, I find that the formatGmt() method ...
11
votes
2answers
192 views

DateTime.format() unexpected behavior

Hi I am executing following code snippet and after 26/12/2015, date shifted to one year ahead of expected. Date startDate = Date.parse('12/24/2015'); Date endDate = Date.parse('12/30/2015'); while(...
4
votes
0answers
85 views

API Calls timezone details

When making an API call to SendEvent or OpenEvent objects in the REST API, the return value is in Central time. How do I know what timezone it is using for the dates that I pass as arguments? If I ...
2
votes
2answers
53 views

How To Increment Datetime by Decimal?

I have a packaged application installed in my salesforce which sends the Service Duration (Number Data Type) = 3,600.00 and another field Scheduled Date Time 12/21/2015 2:00 PM (DateTime Field Type). ...
0
votes
1answer
18 views

Want to Check whether the Account create date is within the Business Hour or Not

I am creating a account so while creation it should check whether the created date is within the Business Hour or not. If yes do Action 1 else Action 2.
1
vote
2answers
306 views

Workflow Field Update - set date/time field to NOW() but without seconds precision

I need to update a date/time field when a picklist "Status__c" is changed. If the user does not provide their own value in the date/time field when changing the "Status__c" field, the Workflow Rule ...
0
votes
1answer
105 views

Datetime from string with user locale

I am making rest api, In rest method I recieve Datetime parameter. In javascript datetime string looks this: "2015-12-01T12:44:00.000+0000" This is in the same format as I recieved from apex rest. My ...
2
votes
2answers
66 views

Javascript datetime saved in SF field incorrectly

I have a html form where one of the input is date time. <input type="datetime-local"/> I am reading the form inputs using jQuery and sending them to the controller using actionFunction and ...
0
votes
0answers
110 views

Date time picker from jquery ui

I am using the jquery date time picker in my code for one field.i have uploaded all the files in static resources and calling in my code. In my own developer org it is working fine.but in sandbox it ...