diff --git a/KISSmetrics/query_string.py b/KISSmetrics/query_string.py
index 4765b2c..4013d3a 100644
--- a/KISSmetrics/query_string.py
+++ b/KISSmetrics/query_string.py
@@ -43,7 +43,7 @@ def create_query(key, person, event=None, timestamp=None,
     query_dict = {KEY_KEY: key, PERSON_KEY: person}
     if timestamp:
         query_dict[TIME_FLAG_KEY] = 1
-        query_dict[TIME_KEY] = timestamp
+        query_dict[TIME_KEY] = int(timestamp)
     if event:
         query_dict[EVENT_NAME_KEY] = event
     if identity:

Support for timestamps submitted as floats
From Dylan:
"
Currently, if someone using the Python library (and potentially other libraries) tries to send in a float as a timestamp, it gets converted to something like 1426982400.0. This doesn't generate any errors, and it shows up in the live tab just fine, but any events recorded with this timestamp won't be properly processed and won't show up in a user's account.
"

diff --git a/KISSmetrics/tests/test_kissmetrics.py b/KISSmetrics/tests/test_kissmetrics.py
index bfc5734..a15ba99 100644
--- a/KISSmetrics/tests/test_kissmetrics.py
+++ b/KISSmetrics/tests/test_kissmetrics.py
@@ -113,7 +113,7 @@ class TestKISSmetricsRequestFunctionsTestCase(unittest.TestCase):
         assert parse_qs(query_string)['_p'] == ['bar']
         assert parse_qs(query_string)['_n'] == ['fizzed']
 
-    def test_record_with_timestamp(self):
+    def test_record_with_integer_timestamp(self):
         query_string = KISSmetrics.request.record(key='foo', person='bar', event='fizzed', timestamp=1381849312)
         assert urlparse(query_string).path == '/e'
         query_string = urlparse(query_string).query
@@ -122,6 +122,24 @@ class TestKISSmetricsRequestFunctionsTestCase(unittest.TestCase):
         assert parse_qs(query_string)['_d'] == ['1']
         assert parse_qs(query_string)['_t'] == ['1381849312']
 
+    def test_record_with_whole_float_timestamp(self):
+        query_string = KISSmetrics.request.record(key='foo', person='bar', event='fizzed', timestamp=1381849312.0)
+        assert urlparse(query_string).path == '/e'
+        query_string = urlparse(query_string).query
+        assert parse_qs(query_string)['_k'] == ['foo']
+        assert parse_qs(query_string)['_p'] == ['bar']
+        assert parse_qs(query_string)['_d'] == ['1']
+        assert parse_qs(query_string)['_t'] == ['1381849312']
+
+    def test_record_with_non_whole_float_timestamp(self):
+        query_string = KISSmetrics.request.record(key='foo', person='bar', event='fizzed', timestamp=1381849312.5)
+        assert urlparse(query_string).path == '/e'
+        query_string = urlparse(query_string).query
+        assert parse_qs(query_string)['_k'] == ['foo']
+        assert parse_qs(query_string)['_p'] == ['bar']
+        assert parse_qs(query_string)['_d'] == ['1']
+        assert parse_qs(query_string)['_t'] == ['1381849312']
+
     def test_record_custom_path(self):
         query_string = KISSmetrics.request.record(key='foo', person='bar', event='fizzed', path='get')
         assert urlparse(query_string).path == '/get'
@@ -150,6 +168,28 @@ class TestKISSmetricsRequestFunctionsTestCase(unittest.TestCase):
         assert parse_qs(query_string)['_t'] == ['1381849312']
         assert parse_qs(query_string)['cool'] == ['1']
 
+    def test_set_with_whole_float_timestamp(self):
+        properties = {'cool': '1'}
+        query_string = KISSmetrics.request.set(key='foo', person='bar', properties=properties, timestamp=1381849312.0)
+        assert urlparse(query_string).path == '/s'
+        query_string = urlparse(query_string).query
+        assert parse_qs(query_string)['_k'] == ['foo']
+        assert parse_qs(query_string)['_p'] == ['bar']
+        assert parse_qs(query_string)['_d'] == ['1']
+        assert parse_qs(query_string)['_t'] == ['1381849312']
+        assert parse_qs(query_string)['cool'] == ['1']
+
+    def test_set_with_non_whole_float_timestamp(self):
+        properties = {'cool': '1'}
+        query_string = KISSmetrics.request.set(key='foo', person='bar', properties=properties, timestamp=1381849312.5)
+        assert urlparse(query_string).path == '/s'
+        query_string = urlparse(query_string).query
+        assert parse_qs(query_string)['_k'] == ['foo']
+        assert parse_qs(query_string)['_p'] == ['bar']
+        assert parse_qs(query_string)['_d'] == ['1']
+        assert parse_qs(query_string)['_t'] == ['1381849312']
+        assert parse_qs(query_string)['cool'] == ['1']
+
     def test_set_custom_path(self):
         properties = {'cool': '1'}
         query_string = KISSmetrics.request.set(key='foo', person='bar', properties=properties, path='get')

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
exceptiongroup==1.2.2
iniconfig==2.1.0
packaging==24.2
pluggy==1.5.0
-e git+https://github.com/kissmetrics/py-KISSmetrics.git@3e1819f735771472c112ee471ec732e5a8277bfe#egg=py_KISSmetrics
pytest==8.3.5
pytest-cov==6.0.0
tomli==2.2.1
urllib3==1.26.20

name: py-KISSmetrics
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - tomli==2.2.1
      - urllib3==1.26.20
prefix: /opt/conda/envs/py-KISSmetrics

KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_record_with_non_whole_float_timestamp KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_record_with_whole_float_timestamp KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_set_with_non_whole_float_timestamp KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_set_with_whole_float_timestamp
KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientTestCase::test_client_http_object KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientTestCase::test_client_key KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientTestCase::test_client_scheme KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientCompatTestCase::test_client_compat_check_identify KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientCompatTestCase::test_client_compat_check_init KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientCompatTestCase::test_client_compat_http_object KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientCompatTestCase::test_client_compat_key KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientCompatTestCase::test_client_compat_log_file KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientCompatTestCase::test_client_compat_now KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientCompatTestCase::test_client_compat_scheme KISSmetrics/tests/test_kissmetrics.py::KISSmetricsClientCompatTestCase::test_compatibility_alias KISSmetrics/tests/test_kissmetrics.py::KISSmetricsRequestTestCase::test_alias KISSmetrics/tests/test_kissmetrics.py::KISSmetricsRequestTestCase::test_event KISSmetrics/tests/test_kissmetrics.py::KISSmetricsRequestTestCase::test_minimum KISSmetrics/tests/test_kissmetrics.py::KISSmetricsRequestTestCase::test_set KISSmetrics/tests/test_kissmetrics.py::KISSmetricsRequestTestCase::test_timestamp KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_alias KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_alias_custom_path KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_record KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_record_custom_path KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_record_with_integer_timestamp KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_set KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_set_custom_path KISSmetrics/tests/test_kissmetrics.py::TestKISSmetricsRequestFunctionsTestCase::test_set_with_timestamp
KISSmetrics/query_string.py
KISSmetrics/query_string.py