Thousands of tools! Check out Online Tools – I have now added thousands of tools.
I often have to generate random UNIX timestamps so I created this simple online utility that does it for me. It lets you generate however many random POSIX times you need from a 64-bit time range. It works in the browser and is powered by alien technology from the future.
Random Unix Time Generator Options
Random Unix Time Generator Examples (click to try!)
2778969262; 3441215074; 3851070691; 3083863007; 2739966270; 2150832026; 3928672706; 4063842230; 2183940864; 4003408067; 4017133932; 2582071655; 3388338309; 4085543795; 1386976856; 2141214477; 1673730790; 1223411106; 3085174762; 2027793165; 1108063005; 1928292881; 3708219423; 1187472982; 1410100914; 1617439400; 3293203960; 3225995232; 1749279364; 1847168730; 1072423759; 1432851289; 3304870588; 1312866934; 2353095855; 2156996462; 1397875311; 4074067044; 3543568035; 2809368733; 3739483081; 3972136243; 4010869491; 1903904857; 3690251585; 2576026194; 3089624082; 3200901912; 2081743204; 3191239114
1100000010010101100111011100011 1011110101010011010111100011010 1010110101000001000010011010000 1111001010000011000101011100010 1001101110101011010000011000100 1100101010110100010011110100011 1000111110111011101010011 1101010000110011100101100011100 101000111111001000100010000111 1100101101011110001110011100 1100000110111100101001010000 1100010111001011100010011000100
-3969078365758 (-123806-11-29 23:44:02) -1952374339938 (-59899-09-20 18:27:42) 193814575328 (8111-09-28 06:02:08) -7859570563688 (-247090-02-15 02:31:52) -656285484026 (-18827-02-21 04:39:34) -640121063841 (-18315-05-15 09:22:39) -4045418147344 (-126225-10-20 16:50:56) 2162812993179 (70506-10-25 18:59:39) -4045973595913 (-126242-03-14 21:34:47) -4018739172180 (-125379-03-24 03:17:00)
How Does This Random Unix Time Generator Work?
This random POSIX time generator works entirely in your browser and is written in JavaScript. It creates random timestamps that are seconds since 00:00:00 UTC on January 1, 1970. The timestamp range is specified in the options as start
and end
variables. To convert the range dates to Unix time, the program calls the Date.UTC(…)
function with years, months, days, hours, minutes, seconds arguments that are extracted from these dates. To generate a random timestamp
between the two Unix times start
and end
, it generates a random integer via the formula Math.floor(Math.random()*(end-start+1))+start
. In total, it generates count
timestamps. The generation is done via a simple for
loop that runs from 1
to count
(specified in options). If the repetition option is enabled, it checks if the current timestamp
was already added to the times
array. If it was, then it repeats the loop. Otherwise, it push
es the new timestamp
to the array. If the "Show Human Time" option is enabled, it converts the timestamp
to a date string through a new Date(timestamp)
object and extracts years, months, days, hours, minutes, and seconds from the date object via the getUTCFullYear()
, getUTCMonth()
, getUTCDate()
, getUTCHours()
, getUTCMinutes()
, getUTCSeconds()
methods and appends the human readable time in "YYYY-MM-DD HH:MM:SS" format to the timestamp
. Sometimes, the Epoch time needs to be converted to another base, such as binary or hexadecimal. When such conversion is needed, the BigNumber
JavaScript library comes handy. By constructing a new big number object bigNum
from a timestamp
via bigNum = new BigNumber(timestamp)
, it can be easily converted to a number in the specified base via bigNum.toString(base)
. When the array times
is filled with the necessary number of elements, the program turns it into a string by executing the times.join(separator)
method and prints it to the screen.
Created by Browserling
This random unix time generator was created by me and my team at Browserling. Behind the scenes, it's actually powered by our web developer tools that are used by millions of people every month. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!
Secret message: If you love my tools, then I love you, too! Use coupon code TOOLLING to get a discount at my company.