You need to sign in to do that
Don't have an account?
Mitchell McLaughlin 10
Get Current Time in Lightning Component
Hello All,
I'm trying to get EST current time oninit whenever my lightning component is opened. I have concerns about pulling the time in the user's timezone as they are not necessarily in eastern. I also have concerns about pulling the general time of GMT which is used in SFDC development because of daylight savings.
Basically, I want to always dynamically hide a component if it is before 8:30 in the morning.
Please help! Thanks.
I'm trying to get EST current time oninit whenever my lightning component is opened. I have concerns about pulling the time in the user's timezone as they are not necessarily in eastern. I also have concerns about pulling the general time of GMT which is used in SFDC development because of daylight savings.
Basically, I want to always dynamically hide a component if it is before 8:30 in the morning.
Please help! Thanks.
Kindly refer the below 2 links. Hope these are helpful to you
https://salesforce.stackexchange.com/questions/164230/how-can-i-quickly-get-todays-date-in-a-lightning-component-for-use-in-an-attr
https://salesforce.stackexchange.com/questions/175573/how-to-get-current-date-as-per-logged-in-user-in-lightning-component/175677
Follow below code, it will help you to show date in lightning component
Component:
I suggest to visit these links,it will help you
https://salesforce.stackexchange.com/questions/200889/how-to-get-todays-date-in-a-lightning-component-based-on-their-server-side-time
https://salesforce.stackexchange.com/questions/164230/how-can-i-quickly-get-todays-date-in-a-lightning-component-for-use-in-an-attr/164231
https://www.biswajeetsamal.com/blog/salesforce-lightning-formatted-datetime/
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.