Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Time printed is not displaying correctly.

Avatar

Avatar
Boost 1
Level 2
islandgirl23
Level 2

Likes

2 likes

Total Posts

69 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
Give Back
Ignite 1
Validate 1
View profile

Avatar
Boost 1
Level 2
islandgirl23
Level 2

Likes

2 likes

Total Posts

69 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
Give Back
Ignite 1
Validate 1
View profile
islandgirl23
Level 2

18-04-2021

Hello,

I have the following in my form, but when I print the form, the time is printing incorrectly.  It reads 4/18/2021 @ 7:6:38.  What is wrong with the script?

var oNow = new Date();
this.rawValue = (oNow.getMonth() + 1) + "/" + oNow.getDate() + "/" + oNow.getFullYear() +
" @ " + oNow.getHours() + ":" + oNow.getMinutes() + ":" + oNow.getSeconds();

 

Your help is greatly appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

151 likes

Total Posts

341 posts

Correct Reply

97 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

151 likes

Total Posts

341 posts

Correct Reply

97 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Kosta_Prokopiu1
Employee

19-04-2021

Let's assume that the formatting is wrong (single digits?). Here is how I would approach this with a DateTime field

Kosta_Prokopiu1_0-1618831990264.png

Pattern: date{MM/DD/YYYY} '@' time{HH:MM:SS}

Results in

Kosta_Prokopiu1_1-1618832031220.png

 

Answers (0)