You need to sign in to do that
Don't have an account?
Nagarajan C
I want to login user date and time in my js in LWC
I want to login user date and time in my js in LWC so i tired below option.
import LOCALE from '@salesforce/i18n/locale';
import TIME_ZONE from '@salesforce/i18n/timeZone';
// this.locale-'en-US
//timeZone- (GMT-04:00) Eastern Daylight Time (America/New_York)
let dateTime= new Date().toUTCString(this.locale,{timeZone:this.timeZone});
Result is showing in console -Mon, 09 Aug 2021 06:58:18 GMT
but i want expect result is -Mon, 09 Aug 2021 02:58:18 .
So how to get without timezone for all my user.
Thanks
C. Nagarajan
import LOCALE from '@salesforce/i18n/locale';
import TIME_ZONE from '@salesforce/i18n/timeZone';
// this.locale-'en-US
//timeZone- (GMT-04:00) Eastern Daylight Time (America/New_York)
let dateTime= new Date().toUTCString(this.locale,{timeZone:this.timeZone});
Result is showing in console -Mon, 09 Aug 2021 06:58:18 GMT
but i want expect result is -Mon, 09 Aug 2021 02:58:18 .
So how to get without timezone for all my user.
Thanks
C. Nagarajan
Please check out the solution posted over below thread:
https://salesforce.stackexchange.com/a/175677/96007
You might need to go with similar logic to make it work.
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Thanks.