## Discuss Scratch

god286
Scratcher
1000+ posts

### Smartpage

bump

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient

`                 _ ____  ___   __     __ _  ___   __| |___ \( _ ) / /_   / _` |/ _ \ / _` | __) / _ \| '_ \ | (_| | (_) | (_| |/ __/ (_) | (_) | \__, |\___/ \__,_|_____\___/ \___/  |___/                              `
^ inspired by @Chiroyce, made with figlet
NFlex23
Scratcher
1000+ posts

### Smartpage

Why is it in 24 hour time?

MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

NFlex23 wrote:

Why is it in 24 hour time?
there's a way to get 12 hour time in JS

```var 12hr = 24hr - 12
```

signature
mybearworld
Scratcher
1000+ posts

### Smartpage

MagicCrayon9342 wrote:

(#43)

NFlex23 wrote:

Why is it in 24 hour time?
there's a way to get 12 hour time in JS

```var 12hr = 24hr - 12
```
Ah, I see, so if it's 7:00 in 24h time, it's -05:00 in 12h time

then again, why would you want 12h time

Last edited by mybearworld (Jan. 2, 2022 20:21:49)

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

mybearworld wrote:

MagicCrayon9342 wrote:

(#43)

NFlex23 wrote:

Why is it in 24 hour time?
there's a way to get 12 hour time in JS

```var 12hr = 24hr - 12
```
Ah, I see, so if it's 7:00 in 24h time, it's -05:00 in 12h time

```hr24<13 ? [hr24, "am"] : [hr24-12, "pm"]
```
works

then again, why would you want 12h time
It's standard for the United States.

signature
mybearworld
Scratcher
1000+ posts

### Smartpage

MagicCrayon9342 wrote:

It's standard for the United States.
yeah but imperial is too

anyways, since 12h time is weird, the code I orginally gave in my post was incorrect.
```hr24%12 ? (hr24<13 ? [hr24, "am"] : [hr24-12, "pm"]) : (hr24==12 ? [12, "pm"] : [12, "am"])
```
this works.

Last edited by mybearworld (Jan. 2, 2022 20:20:13)

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

mybearworld wrote:

MagicCrayon9342 wrote:

It's standard for the United States.
yeah but imperial is too

anyways, since 12h time is weird, the code I orginally gave in my post was incorrect.
```hr24%12 ? (hr24<13 ? [hr24, "am"] : [hr24-12, "pm"]) : (hr24==12 ? [12, "pm"] : [12, "am"])
```
this works.
As with all code pasted on scratch I'll make a website with a real-world use case for it that I will abandon in a day.

signature
mybearworld
Scratcher
1000+ posts

### Smartpage

Last edited by mybearworld (Jan. 2, 2022 20:25:02)

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

its hosted at https://jaydendev.github.io/24to12

ignore the randmsg title this is randmsg but I modified the functions and HTML slightly. I reuse code 24/7

Last edited by MagicCrayon9342 (Jan. 2, 2022 20:34:04)

signature
MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

I could turn it into an iframe-able widget. How do I get the current time in JS.

signature
god286
Scratcher
1000+ posts

### Smartpage

NFlex23 wrote:

Why is it in 24 hour time?
I like it, but then, if people really want, I'll make a setting.

MagicCrayon9342 wrote:

(#50)
I could turn it into an iframe-able widget. How do I get the current time in JS.
new Date()

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient

`                 _ ____  ___   __     __ _  ___   __| |___ \( _ ) / /_   / _` |/ _ \ / _` | __) / _ \| '_ \ | (_| | (_) | (_| |/ __/ (_) | (_) | \__, |\___/ \__,_|_____\___/ \___/  |___/                              `
^ inspired by @Chiroyce, made with figlet
mybearworld
Scratcher
1000+ posts

### Smartpage

MagicCrayon9342 wrote:

(#49)
its hosted at https://jaydendev.github.io/24to12

ignore the randmsg title this is randmsg but I modified the functions and HTML slightly. I reuse code 24/7
it's really nice of you to just take the code I posted and put it on github with a little bit of UI you just reused from a previous project you made but with no more changes nor credit

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

mybearworld wrote:

MagicCrayon9342 wrote:

(#49)
its hosted at https://jaydendev.github.io/24to12

ignore the randmsg title this is randmsg but I modified the functions and HTML slightly. I reuse code 24/7
it's really nice of you to just take the code I posted and put it on github with a little bit of UI you just reused from a previous project you made but with no more changes nor credit
it didn't have a license, saying if i could use it or not or with credit or not!

signature
MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

god286 wrote:

NFlex23 wrote:

Why is it in 24 hour time?
I like it, but then, if people really want, I'll make a setting.

MagicCrayon9342 wrote:

(#50)
I could turn it into an iframe-able widget. How do I get the current time in JS.
new Date()
I mean just the time

signature
god286
Scratcher
1000+ posts

### Smartpage

MagicCrayon9342 wrote:

I mean just the time
new Date()
Please stop making topics off-topic and go somewhere else to ask questions

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient

`                 _ ____  ___   __     __ _  ___   __| |___ \( _ ) / /_   / _` |/ _ \ / _` | __) / _ \| '_ \ | (_| | (_) | (_| |/ __/ (_) | (_) | \__, |\___/ \__,_|_____\___/ \___/  |___/                              `
^ inspired by @Chiroyce, made with figlet
mybearworld
Scratcher
1000+ posts

### Smartpage

MagicCrayon9342 wrote:

it didn't have a license, saying if i could use it or not or with credit or not!

2+2*5 = ?
2+2*5 = 20
2+2*5 = 12
2+2*5 = 77034585053198940266692661
MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

mybearworld wrote:

MagicCrayon9342 wrote:

it didn't have a license, saying if i could use it or not or with credit or not!
i've added credit in the latest commit that im pushing rn
also I need help getting the function at the bottom working
https://github.com/JaydenDev/24to12/blob/gh-pages/index.js#L8

Last edited by MagicCrayon9342 (Jan. 2, 2022 21:06:54)

signature
god286
Scratcher
1000+ posts

### Smartpage

MagicCrayon9342 wrote:

(#57)

mybearworld wrote:

MagicCrayon9342 wrote:

it didn't have a license, saying if i could use it or not or with credit or not!
i've added credit in the latest commit that im pushing rn
also I need help getting the function at the bottom working
https://github.com/JaydenDev/24to12/blob/gh-pages/index.js#L8
MAGICCRAYON9342
Please stop being offtopic. I'm only fine with it because you didn't give credit to mybearworld for the code. If this happens again I'll have to politely ask you to stop posting on my threads.

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient

`                 _ ____  ___   __     __ _  ___   __| |___ \( _ ) / /_   / _` |/ _ \ / _` | __) / _ \| '_ \ | (_| | (_) | (_| |/ __/ (_) | (_) | \__, |\___/ \__,_|_____\___/ \___/  |___/                              `
^ inspired by @Chiroyce, made with figlet
MagicCrayon9342
Scratcher
1000+ posts

### Smartpage

god286 wrote:

MagicCrayon9342 wrote:

(#57)

mybearworld wrote:

MagicCrayon9342 wrote:

it didn't have a license, saying if i could use it or not or with credit or not!
i've added credit in the latest commit that im pushing rn
also I need help getting the function at the bottom working
https://github.com/JaydenDev/24to12/blob/gh-pages/index.js#L8
MAGICCRAYON9342
Please stop being offtopic. I'm only fine with it because you didn't give credit to mybearworld for the code. If this happens again I'll have to politely ask you to stop posting on my threads.
I'm making a 12 hour time widget for YOUR project wdym.
im outta here before I get myself banned

Last edited by MagicCrayon9342 (Jan. 2, 2022 21:11:13)

signature
god286
Scratcher
1000+ posts

### Smartpage

MagicCrayon9342 wrote:

I'm making a 12 hour time widget for YOUR project wdym.
Oh, ok, But I'm confused. Anyways I'll implement 12 hour time soon. I'll use some code that you have given me and give credit, then make a preference for it.

meowclient
Typescript and ESM support
Kind-of good documentation
Easy to use
meowclient

`                 _ ____  ___   __     __ _  ___   __| |___ \( _ ) / /_   / _` |/ _ \ / _` | __) / _ \| '_ \ | (_| | (_) | (_| |/ __/ (_) | (_) | \__, |\___/ \__,_|_____\___/ \___/  |___/                              `
^ inspired by @Chiroyce, made with figlet