function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Cloud AtlasCloud Atlas 

DateTime Value converting incorrectly into Month from Formula

I have a service inserting records and accepting EST values.
"publishedAtEt": "2019-06-13T15:00:33",
"submittedAtEt": "2019-05-01T00:03:34",
Then I have a formula field to figure out the month for "submitted at" value.
INTEGER SUB_MONTH = MONTH(DATEVALUE( Submitted_At__c ))
But upon debugging , I am finding that the SUB_MONTH value is not 5, but 4.
USER_DEBUG |DEBUG|Sub_Month 4
Has anyone ever experienced something like that?
If yes, how did you resolve.
Any help is appreciated.
Thanks!

 
Best Answer chosen by Cloud Atlas
Anant KamatAnant Kamat
The reason for that might be the timezone that is configured at the User record level. Can you please update the user timezone to the same value as EST and check if there is any difference.

All Answers

Anant KamatAnant Kamat
The reason for that might be the timezone that is configured at the User record level. Can you please update the user timezone to the same value as EST and check if there is any difference.
This was selected as the best answer
Cloud AtlasCloud Atlas
Oh my god !!
That was soooo dumb of me.
Thanks so much Anant.
Really appreciate the help.