raahimfareed Posted September 11, 2020 Share Posted September 11, 2020 Let's say I am buying a share for $10. If I sell the share on the same day BEFORE 3:30PM, it will be sold for $10, but if I keep the share past 3:30PM, I want the code to automatically add $1 (Taxes and such) once in the the price of the share in database, after that no matter how many days pass by, the price will remain the same. I've thought about CRON jobs, but I have no idea how to make/use them or set them up. Any direction or help is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/311469-how-can-i-add-a-one-time-x-amount-in-y-after-a-specified-time-automatically/ Share on other sites More sharing options...
requinix Posted September 11, 2020 Share Posted September 11, 2020 You don't have to change anything. Whatever your code is that looks up the amount, update it so that it takes the time into account and adds $1 if it's after 3:30. Quote Link to comment https://forums.phpfreaks.com/topic/311469-how-can-i-add-a-one-time-x-amount-in-y-after-a-specified-time-automatically/#findComment-1581308 Share on other sites More sharing options...
raahimfareed Posted September 11, 2020 Author Share Posted September 11, 2020 (edited) 18 minutes ago, requinix said: You don't have to change anything. Whatever your code is that looks up the amount, update it so that it takes the time into account and adds $1 if it's after 3:30. So, if I understand that right, when the page loads, (refreshes) it checks the time and if the time is past the specified time, it adds the amount? Edited September 11, 2020 by raahimfareed Typo Quote Link to comment https://forums.phpfreaks.com/topic/311469-how-can-i-add-a-one-time-x-amount-in-y-after-a-specified-time-automatically/#findComment-1581309 Share on other sites More sharing options...
requinix Posted September 11, 2020 Share Posted September 11, 2020 Yeah. It's a distinction between an original amount and an effective amount. It's $10 originally and +$1 for the time-based fee thing I don't know for an effective amount of $11. Now, this should all be handled in a single place, so it's not like the page itself is doing this work, but yes: the code starts with the original $10 and then recognizes that it should +$1 because of the time. Quote Link to comment https://forums.phpfreaks.com/topic/311469-how-can-i-add-a-one-time-x-amount-in-y-after-a-specified-time-automatically/#findComment-1581311 Share on other sites More sharing options...
Barand Posted September 11, 2020 Share Posted September 11, 2020 You would also need to know if, and when, the share was sold. Quote Link to comment https://forums.phpfreaks.com/topic/311469-how-can-i-add-a-one-time-x-amount-in-y-after-a-specified-time-automatically/#findComment-1581312 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.