Recently in the game to make a timed push, as if the next day 9 point to inform the player to receive the reward, such as the need to get the second day 9 points of time stamp, before using JS to write a similar demand, JS in the date class used more convenient, a lot of things have been helped to fix, the most important or will automatically handle the time and date The recent write Lua also encountered similar requirements, but after reading the LUA documentation, it was found that Lua is not as convenient as JS, but there is no way to record here, for later viewing, see the code directly
Local Cur_timestamp = Os.time () local One_hour_timestamp = 24*60*60local Temp_time = cur_timestamp + One_hour_timestamp * F Uture_dayslocal temp_date = os.date ("*t", Temp_time) return Os.time ({year=temp_date.year, month=temp_date.month, day= Temp_date.day, Hour=future_hour})
Note: It is simple to say that the time type can be exempt from the problem of the Advanced date (formatted) and the time (numeric type) in Lua, which is a good way to get a timestamp at a certain point in time.
Get time stamps for a future point in Lua