Rank: Newbie
Groups: Approved
Joined: 3/7/2021(UTC) Posts: 2
|
i'm trying to insert the current date using a gesture, but i can't even begin to figure it out. can anyone help?
apologies if this was posted in the wrong section.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
Here's a working example, change the formatting as needed. Code:var d = new Date();
//Build formatted date string, padding single digits with a preceding "0"
var dateString = d.getFullYear()
+ "-"
+ ("0" + (d.getMonth()+1)).slice(-2)
+ "-"
+ ("0" + d.getDate()).slice(-2)
+ " "
+ ("0" + d.getHours()).slice(-2)
+ ":"
+ ("0" + d.getMinutes()).slice(-2);
//Send the date string as keyboard input
sp.SendString(dateString);
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Newbie
Groups: Approved
Joined: 3/7/2021(UTC) Posts: 2
|
thanks for the help! greatly appreciated.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close