Create a beautiful text string from a Unix Time Stamp
(Still under development as of March 15th 2023)
// Create time string
function createTimeString( unixTimeStamp )
{
// Local variables
let date = new Date( unixTimeStamp ),
month = date.toLocaleString('default', { month: 'long' }),
day = date.getDate(),
year = date.getFullYear(),
timeString = `${ month } ${ day }${ retrunNth( day ) }, ${ year }`
// Return formatted string
return timeString
}
// Return ending of day
function retrunNth( day )
{
if ( day > 3 && day < 21 ) return "th"
switch (day % 10)
{
case 1: return "st"
case 2: return "nd"
case 3: return "rd"
default: return "th"
}
}
Call something like createTimeString( 1669120494952 ) and you get a nice string that you can use anywhere in your project.
FAQs
You still have an open question about BMG.studio and how we operate. Chances are good that you will find what you are looking for here:
Why does this FAQ exist?
Well. As of Wednesday, March 15th 2023, I think this component looks really cool.
By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.