Skip to main content
100%

Gist 066cc1deef3173351f9d6b358b93d78b

✓ Published0🌍 Public
Aandrewbt
Last edited Sep 19, 2017
Created on Sep 19, 2017

This visualization generates synthetic timestamp data from year strings using a SQL function that randomly selects a point between January 1 and December 31 of the given year. The example demonstrates how to create randomized temporal values for testing or simulation purposes, with the function `random_time_from_year_string` accepting a year as text and returning a timestamp. The code leverages PostgreSQL's SQL language features, including type casting and arithmetic on timestamp intervals, while using the `random()` function to produce the uniform distribution across the year. The rendering approach is not specified, as the example focuses solely on the data generation logic within the SQL query.

AI-generated description

Similar vizzes