you can convert Unix timestamp into conventional time by using new Date(). var tMinutes(date.getMinutes()-30) console.log(minute) //it will print the time and date according to the above condition in Unix-timestamp format. If rounding is no issue (maybe you will just always enter “rounded” times like 2:00 instead of 1:45), then you can just change that formula to return its difference in minutes, and then divide by 60: DATETIME_DIFF(, "minutes") / 60, 0. var datenew Date() //here I am using '-30' to subtract 30 minutes from the current time. But if I work less then 8:24 on a day, then the formula gives me an incorrect result. Similarly for seconds and minutes, if you don. What is the minimum increment you want to round to for your Hours field? If someone works 7 hours and 15 minutes, do you want it to record 7.25 hours? Or should that round up to 7.5 hours? And what are your rounding cutoffs? Should 8:00am - 1:45pm round up to 6 hours? Or down to 5.5 hours? What about 8:00am - 1:44pm? Go to Format > Number > Custom number format, and then write the format hh:mm:ss, and apply it.
0 Comments
Leave a Reply. |