vex
14 years agoContributor
UTC Time Diffs not working.. haaalp :(
This problem is causing me to pull my hair out.
Assume this code:
This gets logged as:
It's reading the time from the Database as 3/5/2012 5:22:08 PM which is correct, but when doing the time conversion, it's not reading it right - it should be 4 hours 3 minutes, 23 seconds - NOT 364 days! Is this because it's not returning a string, or because aqDateTime.Now is using local computer time while the time stored in the db is UTC time?
Assume this code:
Log.Message "This account expires on " & sSQL(dba, strQuery, "expiration_date") & " (ETA: " & aqConvert.DateTimeToFormatStr(aqDateTime.TimeInterval(aqDateTime.Now, sSQL(dba, strQuery, "expiration_date")), "%#j days, %#H hours, %#M minutes, %#S seconds)")
This gets logged as:
This account expires on 3/5/2012 5:22:08 PM (ETA: 364 days, 4 hours, 3 minutes, 23 seconds)
It's reading the time from the Database as 3/5/2012 5:22:08 PM which is correct, but when doing the time conversion, it's not reading it right - it should be 4 hours 3 minutes, 23 seconds - NOT 364 days! Is this because it's not returning a string, or because aqDateTime.Now is using local computer time while the time stored in the db is UTC time?