Reputation: 36205
I'm working with apps script. In my code I have:
var date =Utilities.formatDate(new Date(), "EST", "yyyy-MM-dd HH:mm:ss");
var now = Date.now();
I'm in the eastern time zone. I ran the function containing the lines above 1 minute ago. As you can see in the screenshot in the lower right corner the actual time and the time in the editor differ by an hour . What am I doing wrong?
Upvotes: 1
Views: 1184
Reputation: 351
As mentioned by Cooper, you probably have a wrong time zone. Take a look in your project properties. Try checking the time zone in your spreadsheet too.
If that doesn't work, try also changing project time zone to a different one and changing it back to your correct time zone.
Upvotes: 2