Ability to convert float data fields to from unix_datetime to normal date

[expired user #8123]'s profile image [expired user #8123] posted 8 years ago in Feature discussion Permalink

Hi,

we have an application that writes unix timestapms with decimal separator for extra-detailed timestamps. For normal integer fields HeidiSQL has this amazing feature to activate a conversion from unix_timestamp to date on browsing data.

However the menu entry is not available when the data field type is DOUBLE.

It should be easy to make this available - can you please consider it?

Thank you for a great tooL!

Best regards

Carsten

ansgar's profile image ansgar posted 8 years ago Permalink

Yes, that shouldn't be a big deal. Only I'm pretty sure I cannot get the microseconds into the simulated date/time field. I guess that's not a problem, as that feature is some icing on the cake anyway.

[expired user #8123]'s profile image [expired user #8123] posted 8 years ago Permalink

I don't care for the microseconds ;). So that would be really great!

Code modification/commit 24be88d from ansgarbecker, 8 years ago, revision 9.3.0.5117
Support all integer and real data types for displaying as Unix timestamp. See http://www.heidisql.com/forum.php?t=22092
ansgar's profile image ansgar posted 8 years ago Permalink

Done in r5117. Please report back if it works for you.

[expired user #8123]'s profile image [expired user #8123] posted 8 years ago Permalink

Thank you!

Unfortunately it does not convert properly. My original value is a field type DOUBLE. On conversion I get 1970-01-01 dates.

Thank you for having another look...

ansgar's profile image ansgar posted 8 years ago Permalink

Works here. At least with "1.0" values :) Sample value which does not work for you?

[expired user #8123]'s profile image [expired user #8123] posted 8 years ago Permalink

Something like

1448687762.0404

Code modification/commit 66c55d2 from ansgarbecker, 8 years ago, revision 9.3.0.5118
Remove FromLocaleFormat from MakeFloat and MakeInt. See http://www.heidisql.com/forum.php?t=22092#p22133
ansgar's profile image ansgar posted 8 years ago Permalink

Ok, next attempt in r5118. Please update.

[expired user #8123]'s profile image [expired user #8123] posted 8 years ago Permalink

Looks better. Most numbers are properly converted now but the value 1473954722.021 still looks strange when converted.

ansgar's profile image ansgar posted 8 years ago Permalink

the value 1473954722.021 still looks strange when converted.

I cannot test right now, however, what do you mean by "strange"?

[expired user #8123]'s profile image [expired user #8123] posted 8 years ago Permalink

Year 40,000 and then some

Code modification/commit 2b12bbc from ansgarbecker, 8 years ago, revision 9.3.0.5119
Next attempt to fix conversion of float values to int/unixtimestamps. See http://www.heidisql.com/forum.php?t=22092#p22159
ansgar's profile image ansgar posted 8 years ago Permalink

r5119 should fix that, hopefully.

[expired user #8123]'s profile image [expired user #8123] posted 8 years ago Permalink

It now works properly. Thank you very much for your effort!

Please login to leave a reply, or register at first.