0

I am using current_timestamp() function as default value of column in my table. Due to which it is picking up the system date as the date value and inserting to the column. Now when I update the system date to a future date it is picking up the future date value and inserting into the table. I want to restrict that by setting the date explicitly at the time of MYSQL server setup or update the my.ini file for the same. Is it possible?

  • why do you need to change your date to 'future' ? (maybe the key is on this question) – 4givN Jan 17 '18 at 09:29
  • it's not me. It's the workers on the field. they can change the date to future date to record data and this is an offline activity, – Prateek Hemani Jan 17 '18 at 10:42
  • According to me, that's pretty hard (to not say impossible). Solution is to get date externally (internet, GPS, networks, ...) or restrict workers to not change system date. Maybe [this thread](https://stackoverflow.com/questions/26969288/android-get-current-time-without-dependency-on-devices-clock) can help – 4givN Jan 17 '18 at 13:08
  • This discussion can help too : [How to protect software from system date-time changes](https://stackoverflow.com/questions/3404045/how-to-protect-software-from-system-date-time-changes) – 4givN Jan 17 '18 at 13:12

0 Answers0