How would I remove this part of the Creation Date retrieved from getProductInfo?

When running GetProductInfo.Created it shows: 2020-08-24T05:52:26.207Z (just an example date.), but I do not want the T05:52:26:207Z part, how would I remove this for just about any creation date so I am only left with 2020-08-24?

There’s probably a better way, but this works:

string.sub(dateString, 1, string.find(dateString, "T")-1)

There’s a bunch of cool stuff you can do with string methods

1 Like

What should I put in s, "T" for s

EDIT: Oh thanks for editing it

1 Like

Or simply, since T would always be in the same position (because the number of months and days would always be 2 digits, and the number of years would only change when we hit the year 10000 which isn’t happening any time soon), you can do str:sub(1, 10).

1 Like