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

learn more… | top users | synonyms

1
vote
2answers
25 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
29 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 ...
3
votes
2answers
567 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
23 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
27 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
52 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
128 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
22 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
40 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
29 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
33 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
46 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
19 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
43 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
35 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
159 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
39 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 ...
1
vote
2answers
30 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
9 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
54 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
37 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
50 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
52 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
23 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
35 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
34 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
27 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
19 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
57 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
11 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
30 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
102 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
38 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. ...
0
votes
0answers
47 views

Convert String Date to DateTime in email

I showing date in email that is in string. I want to convert that into DateTime like(dd-mmm-yyyy hh:mm am/pm). I am trying like DateTime.parse() but it won't work. It's failed and shows the message ...
0
votes
0answers
46 views

Change Date Format

I have my date in following format... 2015-10-28 (YYYY-MM-dd) ... in Email Template. I want it in the following format: 28-Oct-2015 01:31 PM (dd-mmm-yyyy hh:mm am/pm) How can I get this ...
1
vote
1answer
29 views

how to convert “04/09/2015T06:00:00.000Z” into apex datetime

How to convert this text "04/09/2015T06:00:00.000Z" into a valid apex datetime ? where the time should be unmodified
1
vote
0answers
85 views

Select time in date time picker salesforce

I am using a date time field in my visual force page.. Our client wants the time to be selectable instead of typing the time. Is it possible to select the time also like date?
1
vote
1answer
22 views

Remaining minutes in a day

I'm trying to get the remaining minutes of the current day, but the Datetime class its giving me headaches. (I'm going crazy) Datetime now = Datetime.now();//System.now(); System.debug(now); ...
0
votes
2answers
45 views

How do I update the Date part only of a DateTime value in Apex code?

I have a Controller in which I need to update the StartDateTime of an Event, but only the Date part of the field - the time needs to stay the same. How do I do this? Do I need to extract the Time part ...
1
vote
1answer
22 views

Routing leads based upon their time added?

I'm trying to create a lead assignment rule that routes a lead based upon the time it was created. It appears that the only functions available are only based upon date, not time. I looked in the ...
-1
votes
1answer
25 views

How do I Time Stamp on a specific Lead Ownership Change?

How do I create a NOW() time stamp when a Lead changes OwnerId from Queue X to Queue Y? In addition, I will need to create a time stamp when a checkbox gets checked on the record. I've tried the ...
0
votes
0answers
77 views

Formula to Calculate Time Difference Between Two Events [duplicate]

For my organization's Lead page, we'd like to calculate the time difference between a Lead's Ownership being changed from/to a Queue and the time someone checks a checkbox on the Lead record. We are ...
0
votes
1answer
53 views

Process that starts 1 week before a date

I need to make a process that sends out a chatter notification 1 week before a date on an account. I only see options to run the process when a record is created or edited. How can I make it run ...
0
votes
1answer
49 views

Is this a SimpleDateFormat/Datetime bug?

Here is the SimpleDateFormat documentation for reference. The week in year format does not seem to function correctly at year end. For example, if I try to format 2014-12-30 to get this information, ...
1
vote
2answers
128 views

How to do a SOQL Query of DAY_ONLY on a DateTime field?

Here is the problem. We use Stripe to process credit card payments, and Stripe deposits the money into our account two days later, minus fees. I've created a schedulable class that runs every ...
1
vote
1answer
169 views

ADD or SUBTRACT hours from TODAY and YESTERDAY functions in soql

I have to run a load every 6 AM in the morning, so just wanted those records that have been updated or created since this time i.e yesterday 6 AM and today 6 AM. I was thinking to use a logic to add 6 ...
0
votes
0answers
14 views

Analytics - Date Formatting

Is there a way to change the format of a date field which has been imported from salesforce to analytics - the field shows: 2015-05-28T07:20:00.00Z in a raw data table and I want to change to a normal ...
-1
votes
1answer
75 views

Invalid bind expression type of Datetime for column of type Date

for(Sample_Limit_vod__c SL : [select Account_vod__c, Product_vod__c, Disbursed_Quantity_vod__c, ...
0
votes
2answers
75 views

Last Modified date between 30 and 60 days formula

I have a requirement where I have to write a query with a condition that the Last Modified date should be between 30 and 60 days and this should be configurable by user. I have created a custom ...
1
vote
1answer
57 views

JSON.deserialize adding time

CalEvent calEvent = (CalEvent) JSON.deserialize(calEventJson, Technician_Dispatch_Util.CalEvent.class); System.debug('OGDEBUG TDU calEventJson '+calEventJson); System.debug('OGDEBUG TDU ...