Skip to main content

Timestamp

Git Source

Functions

toPaddedString

Convert a timestamp to a padded string of the form "YYYY-MM-DD"

This has only been tested up to year 2345.

function toPaddedString(uint48 timestamp) internal pure returns (string memory, string memory, string memory);

Parameters

NameTypeDescription
timestampuint48The timestamp to convert

Returns

NameTypeDescription
<none>stringyear Year as a zero-padded string
<none>stringmonth Month as a zero-padded string
<none>stringday Day as a zero-padded string