[SOLVED] Â Datetime errors using View As Custom |
5/20/2019 4:40:37 PM |
PHPRunner General questions | |
R
rmac author
Wondering if anyone else has seen this: $value = date("m-d-Y <\b\\r> H:i"); in View As Custom. It worked as expected, except everytime the page would refresh, all of the values would update to the current date and time. I though it was a problem using now() as a default (and may still be somehow related) but it seems like it's even doing it with the now() default removed. Interestingly, it also seems to be all in the browser (tried both Chrome and Edge); if I check the underlying tables the values do not change, and if I change the View As back to regular datetime, the original values reappear. |
|
W
|
WilliamBDevClub member 5/21/2019 |
Here are a couple ways. Not tested as I am not at home.
|
admin 5/21/2019 | |
PHP's date() function expects second parameter to be a timestamp. If none given it will just use the current datetime: $value = date("m-d-Y <\b\\r> H:i", strtotime($value)); |
R
|
rmac author 5/22/2019 |
Once again, operator error. Of course, converting it into a string did the trick. |