How to Convert Time to TSO Value

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 如何转化时间为tso值

| username: wluckdog

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] Any version
[Encountered Problem: Problem Description and Impact]

How to convert time to TSO value
[Resource Configuration]
My idea is, if CDC might have data issues, I want to replay 10 hours of data, and the GC time is also set to 24h.
How to get the TSO value for a specific time to resynchronize this data. Similar to OGG re-extracting data within a certain time range.

| username: tidb菜鸟一只 | Original post link

SELECT FROM_UNIXTIME(CONV(LEFT(BIN(‘430457637306368001’),41),2,10)/1000);
SELECT TIDB_PARSE_TSO(‘430457637306368001’)

| username: 啦啦啦啦啦 | Original post link

select conv(concat(bin(unix_timestamp('2023-04-06 16:52:23')*1000),'000000000000000001'),2,10);
| username: xingzhenxiang | Original post link

The image is not visible. Please provide the text you need translated.