Reputation: 1
How would I store "yy," "dd," and "MM," in a var?
var date = Utilities.formatDate(unformattedDate, "EST", "MM/dd/yy");
Upvotes: 0
Views: 120
Reputation: 9581
I'm assuming that you want the formatted values of "yy", "dd", and "MM", so you should look at using split()
.
var date = Utilities.formatDate(unformattedDate, "EST", "MM/dd/yy");
var dateParts = date.split("/"); // [MM, dd, yy]
var month = dateParts[0];
var day = dateParts[1];
var year = dateParts[2];
Upvotes: 1