Can you replace a date format with another date format?

I usually work with dates like this 5/28/21 at 8:13pm and I have to change it manually to Friday May 28th, 2021 at 8:13 pm (with the space between the hour and am/pm). I know there must be a way of doing that with Text Blaze to save time. I always get the dates in that way from a text.

I will appreciate any help

Hi @Hernan_David_Rosero,

Here's how you can do that.

First, I'm going to give you an example by using a fixed bit of text, so you can see how it works.

{time="5/28/21 at 8:13pm"}

{time: dddd MMMM Do, YYYY [at] h:mm a; at={=time}; pattern=M/D/YY at h:mma}

Now, here are a couple of variants. The first one uses the {clipboard} command. You won't be able to see it at work on the forum, because the {clipboard} command is disabled here. But if you copy it to your dashboard you'll see that it works.

For this to work you need to:

  1. Copy this snippet to your Text Blaze dashboard
  2. Copy the date and time into your clipboard
  3. Insert the snippet

Note that the date and time need to be exactly in that format, otherwise it won't work.

{time={clipboard}}

{time: dddd MMMM Do, YYYY [at] h:mm a; at={=time}; pattern=M/D/YY at h:mma}

Another option is to have a text field where to input your date and time, which would allow you to edit it in case it doesn't match the exact format. Here's what that looks like:

{formtext: name=time; default={clipboard}}

{time: dddd MMMM Do, YYYY [at] h:mm a; at={=time}; pattern=M/D/YY at h:mma}

Let me know if this solves your issue :slight_smile:

Wow! Amazing!

Thank you so much, it worked!

1 Like