Timeline for answer to Check if the time is more than 24h and show it by Fikfattt
Current License: CC BY-SA 4.0
Post Revisions
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 12, 2021 at 6:56 | comment | added | Fikfattt |
i dont know your code to get data from database is okay if i try at my local the only problem if i use $currentTime = date(''); , but if use $currentTime = date('Y-m-d H:i:s'); its work
|
|
| Jan 12, 2021 at 6:25 | comment | added | Fikfattt |
whats the meaning It is still returning the incorrect value. ? its always returning else condition ? or something else?
|
|
| Jan 12, 2021 at 6:15 | comment | added | Alessandro | That doesn't have anything to do with dates? I am returning the correct date from my db. | |
| Jan 12, 2021 at 6:13 | comment | added | Fikfattt | try this stackoverflow.com/questions/5456626/… | |
| Jan 12, 2021 at 6:10 | comment | added | Alessandro | Yeah, that would be a static time. I need to fetch it from db to check the last vote the user did. | |
| Jan 12, 2021 at 6:07 | comment | added | Fikfattt |
maybe the problem is when you call $voteDate->VoteDate , if you only input 2021-01-11 19:58:04.277 to my code its work
|
|
| Jan 12, 2021 at 6:02 | comment | added | Alessandro |
By doing echo $voteDate->VoteDate this is the output 2021-01-11 19:58:04.277. This value is stored in the MSSQL.
|
|
| Jan 12, 2021 at 5:59 | comment | added | Fikfattt |
you can tell me the result if you echo $voteDate->VoteDate ?
|
|
| Jan 12, 2021 at 5:51 | comment | added | Alessandro |
I've changed it to: "SELECT TOP 1 VoteDate FROM dbo.vote WHERE Account = :account ORDER BY VoteDate DESC" In order to get the last vote date that was inserted in the db. but still same problem
|
|
| Jan 12, 2021 at 5:20 | comment | added | Fikfattt |
maybe because when you get VoteDate its not call only one data, try use LIMIT 1 after ORDER BY logid DESC
|
|
| Jan 12, 2021 at 5:14 | comment | added | Alessandro | It is still returning the incorrect value. | |
| Jan 12, 2021 at 5:01 | history | edited | Fikfattt | CC BY-SA 4.0 |
added 7 characters in body
|
| Jan 12, 2021 at 4:55 | history | answered | Fikfattt | CC BY-SA 4.0 |