This is a Lua module to translate snowflakes from platforms such as Twitter and Discord to timestamps. This can be used for automatically generating dates for templates like .
There is one required parameter:, which must be the snowflake ID of the tweet. For example, 1345021162959503360
.
<nowiki>{{#invoke:TwitterSnowflake|snowflakeToDate|id_str=1345021162959503360}}</nowiki>
returns .
To specify the date format, use .
<nowiki>{{#invoke:TwitterSnowflake|snowflakeToDate|id_str=1345021162959503360|format=%e %B %Y}}</nowiki>
returns — useful to specify, especially for use in CS1 citations, in case the default date format would change in the future (though unlikely).
By default, the epoch used is that of Twitter. To specify a different epoch, such as that of Twitter, use . The epoch of Discord is 1420070400
<nowiki>{{#invoke:TwitterSnowflake|snowflakeToDate|id_str=797545051047460888|epoch=1420070400}}</nowiki>
returns .