내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Current local time or lolcal time zone code (example, as EST), not as Eastern Standard Time

Avatar

Level 4

Hello,

Pls. let me know the JS or FormCalc script code snippet for getting the current local time in HH:MM:SS format, or if not possible, then the current local time zone as codes, example, EST

Thank you

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

Hi,

Try using;

util.printd("HH:MM:SS Z", new Date(), true)

Or to just get the time zone code;

util.printd("HH:MM:SS Z", new Date(), true).substring(9)

If you want a more verbose version you can use;

new Date().toLocaleFormat("%Z")

Regards

원본 게시물의 솔루션 보기

8 답변 개

Avatar

Level 4

Any help pls.?

Thank you

Avatar

Level 4

In the custom Object library there is a field called "Current Date". In the Object tab of that field you can set the runtime property to be the current time and it should display the current time and time zone. For example I created a new form, selected that field, changed it to a runtime property and when I open the PDF it says "1:38:10 PM CST". Is that what you are wanting?

Avatar

Level 4

Thank you.

Actually, for some other reason I need to get local time zone, pls. let me know the JS code for to get local time zone

Regards

Avatar

Level 4

Are you saying that you want the time displayed as your local time or as the user that is completing it? The example I gave has my time zone which is Central Standard Time or CST. Did you want to convert the time to Eastern time or leave it as the time zone the user is in?

Avatar

Level 4

Sorry for confusion, let me make it simple.

1) I placed a free text feld, say its name is my_text_zone on my_form

2) Then I gonna put JS in INITIALIZATION event of my_text_zone, which determined the local time zone,as below

Example, now I'm in EST, hence I will see EST when i open the form, same for you but it's as CST

In short, I want to populate/display the user local time zone on the field / form

Thank you

Avatar

정확한 답변 작성자:
Level 10

Hi,

Try using;

util.printd("HH:MM:SS Z", new Date(), true)

Or to just get the time zone code;

util.printd("HH:MM:SS Z", new Date(), true).substring(9)

If you want a more verbose version you can use;

new Date().toLocaleFormat("%Z")

Regards

Avatar

Level 4

Perfect, Thank you

Avatar

Level 4

Hello,

We are a multi national private company, located in Washington DC, we are looking for a expert LC developer with excellent JS expertise, its 3 months project, pls. reply ASAP if you are available, interviews will be immediate (no remote work pls.)

Thank you