Creating a virtual timescale - is that even possible with Influx?

Hey there,

I’m in a tryout phase with Influx and was wonderin if it will work in my use-case scenario. I need a timeseries database with an individual timestamp-series, so f.e. starting with 0, 60, 120, 180 , … . All I found so far is that you can write/transfer points/records with a unix-timestamp. I also wonder : if I would generate a timestamp f.e. one year in the past, how can I see/monitor the results in the browser-UI (because the maximum timescale you can natively choose is past 30d) ?

Hello @ben_bln,
Yes you must write points with a unix timestamp. However, there are a lot of ways to manipulate timestamps with Flux. Please see:

You can see all historical time series data in the UI. You must select a custom date. Or you can not use dashboard variables, and navigate to the Script editor and change the range function start value to -1y.

Please let me know if that’s enough to get you started or if you need more assistance.

Hey @Anaisdg

thanks for answering!
Yea i tried this and it works, however it feels a bit like a workaround. So you cannot create a completely new timescale, but you can start f.e. from 0 and filter by year 1970 to get the results…

When I do this I can read the data in the browser with the suggested custom time period you mentioned, but when I wanna read the data via c# query my memory gets fuller and fuller with no results visible…?

here’s the code

            var ownflux = "from(bucket:\""+bucket+ "\") |> range(start: 0) |> filter(fn: (r) => r._measurement == \"" + measurement+"\")";


            var fluxTables = await client.GetQueryApi().QueryAsync(ownflux, org);
            fluxTables.ForEach(fluxTable =>
            {
                var fluxRecords = fluxTable.Records;
                fluxRecords.ForEach(fluxRecord =>
                {
                    Console.WriteLine($"{fluxRecord.GetTime()}: {fluxRecord.GetValue()}");
                });
            });

(full code is visible in my other thread)

for people who might have the same issue I share the little code snippet :

long UnixTimeNanoseconds(int added_minute, int substracted_years)
            {
                DateTime epochStart = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
                return (DateTime.UtcNow.AddYears(substracted_years).AddMinutes(added_minute) - epochStart).Ticks * 100;
            }