Reputation: 137
I guess I am getting too tired and should jump into bed instead of drinking more coffee. Anyway, all I want to do is increase the current output (so, 13:30) of the variable below by 30 mins. Any idea how to achieve this? Thanks :).
let startTime = Utilities.formatDate(new Date(data[0][6]), 'GMT+1', 'HH:mm');
Upvotes: 1
Views: 727
Reputation: 201758
In your situation, how about the following modification?
let startTime = Utilities.formatDate(new Date(new Date(data[0][6]).getTime() + (30 * 60 * 1000)), 'GMT+1', 'HH:mm');
In this case, 30 minutes are added to new Date(data[0][6])
. If data[0][6]
is the date object, you can modify it as follows.
Utilities.formatDate(new Date(data[0][6].getTime() + (30 * 60 * 1000)), 'GMT+1', 'HH:mm')
Upvotes: 1