Simple question about date-strings

time
currenttime
#1

Hi guys.

I just can’t seem to make this string work.

Command: !test
Response: Todays date is: (currenttime Europe/Copenhagen, dd. MMMM, yyyy)

Unfortunately, I don’t understand the string-setup, primily the use of .

I use a string like this (“dd. MMMM’, 'yyyy HH:mm:ss”) in a .js file, but that doesn’t seem to help me much.

When the above works as expected, I want to insert day (E), but again, not sure how to.

I am trying hard to understand the syntax of these time/date-strings, but I can’t figure out the logic of it.

Thanks.
Michael.

#2

The tag (currenttime) is not related to streamInfo.js which you previously edited. Use the tag as specified in the FAQ:

#3

Hi @BantomPhot

I already use that string for time, but trying to make a ‘date-only’-string.

like ‘Wednesday, 22. april, 2019’.

/Michael.

#4

Oh, I see. The easiest way is not to use comma before the year, it break the tag.

1 Like
#5

Much better! As simple as that :smiley:

Thanks!

#6

If you want comma so much, then use this:

(currenttime Europe/Copenhagen, dd. MMMM',' yyyy)

1 Like
#7

I was SO close to figure it out myself, but I was missing a ‘space’ in the right place :smiley:

You are my man! :smiley:

#8

Tbh, at first I was sure it couldn’t work that way. Then I looked inside customCommands.js and was like “Hell, why not?”. So the result was almost your variant with a small change :slight_smile: