Skip to content
Advertisement

Add one day for certain time

I want to update my date column with certain times because some of the dates are not correct. For some reason, they key in the date with time between 00:00 and 7:30 with the day before.

For example:

JavaScript

Which supposes to be like this:

JavaScript

I know I can update all of dates with this code.

JavaScript

But I have no idea how to only update certain rows I want.

Does anyone know how to update the date column?

Advertisement

Answer

while the other answers are correct and efficient, i’d like to add the long answer using a for loop and an if statement

JavaScript

input:

JavaScript

output:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement