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

learn more… | top users | synonyms

0
votes
1answer
9 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
21 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
62 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 ...
8
votes
1answer
192 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
64 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
43 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
25 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 ...
1
vote
1answer
95 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
193 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
84 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
230 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
48 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
28 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
32 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
42 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
24 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
17 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
37 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
53 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
589 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
37 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
55 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. ...
-1
votes
1answer
65 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
143 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 ...
2
votes
1answer
32 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
61 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 ...
3
votes
1answer
73 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
50 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
57 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
21 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
85 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
54 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
184 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'); ...
4
votes
0answers
61 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
44 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
13 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
180 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
63 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
59 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
84 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 ...
1
vote
0answers
24 views

Adding a time to datetime

I need some help correcting the time when doing a datetime convert. Currently when running the script below I get a time of 12:00AM - I need it to state 8:03AM SELECT ...
0
votes
1answer
52 views

AMPscript showing Email Open Date/Time

I am using MotioMail to show a countdown timer, e.g., http://s.mmgo.io/t/Ono, in the email. However, if user opens the email after the expired date/time, I want to hide the timer and switch to a ...
1
vote
1answer
40 views

How to compare Datetime field with SystemTime.now() in SOQL query

I have a 2 datetime field(Start_Time__c and End_Time__c) and I need to compare them with current time. I am writing the following SOQL Query : Select id from objTime where Start_Time__c >= ...
0
votes
0answers
39 views

Salesforce showing datetime one hour later some time earlier when adding 1 year in datetime

I have a trigger on a custom object, it creates child records using parent datetime fields for next five years. But on some child record, the Time of StartDate (datetime field) differs by 1 hour ...
0
votes
1answer
31 views

Formula to get “Date” based on Activity History Subject

Since Activity History combines everything such as Calls, Marketo, Email, Etc. In CONTACTS. I am looking for a formula that will get the last activity date based on the subject that contains "Email" ...
1
vote
2answers
113 views

Date.Format('EEEE') doesn't give day of week

When I try the following: Date now = Date.today(); String dayOfWeek = now.format('EEEE'); System.debug('****** now: ' + now + ' ' + dayOfWeek); I get the following error: Method does not exist or ...
0
votes
0answers
12 views

No Time selector available when settings

I have a DateTime field where it is important for me to set both the Date and the Time, but when I edit the field it only opens up a Calendar which lets me choose the Date, and it automatically sets ...
0
votes
0answers
38 views

Convert Date to Datetime Formula

I need to convert the following formula to DateTime based. Can you assist? IF(C1_Date__c = TODAY()-1, 1, 0) + IF(C2_Date__c = TODAY()-1, 1, 0) + IF(C3_Date__c = TODAY()-1, 1, 0) + IF(C4_Date__c = ...
2
votes
1answer
218 views

Datetime format ignores am/pm?

Hi I am new to apex coding and am trying to parse a datetime and then later on in my program I am trying to convert it back into a string to query items. For converting a string into a datetime I am ...
1
vote
0answers
43 views

Change date from 12-31-2015 into 31-Dec-15

How can I change the format of the date from the format of 12-31-2015 into the format of 31-Dec-15? Is this even possible in salesforce? As much as possible I want to avoid coding. Thanks in advance. ...