I want to change the format of the date in the script using the doGet function.

Asked 1 years ago, Updated 1 years ago, 41 views

Nice to meet you.

Using the following article as reference, I have written a script using the doGet function.

[Workflow created with GAS] How to create a script that says "approval" by clicking the URL

To quote the date with the body as follows,

body+=`·Purchase date: ${date}\n`;

This is what it looks like:

Mon Jul 13 2020 00:00:00 GMT+0100 (British Summer Time)

"On the spreadsheet, ""13/07/20"" is displayed, but is there a simple way to display it in the same way?"

I would appreciate your help.
I look forward to your kind cooperation.

google-apps-script

2022-09-30 17:52

1 Answers

I don't know the script that causes the problem, so I don't know if it's a direct solution, but if you use getValues() to get the value, you might want to change it to getDisplayValues().

Note:
Class Range | Apps Script | Google Developers

In addition, if you are using Web Apps, redeploy Web Apps as a new version when you change the script.This will reflect the latest scripts.Please be aware of this.

This post was posted as a community wiki based on @Tanaike's comments.


2022-09-30 17:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.