This library performs conversion operations between Unix timestamp and human readable time.
struct Date {
uint8 day;
uint8 month;
uint16 year;
uint8 hour;
uint8 minute;
uint8 second;
int8 gmt;
}
error InvalidGmtValue(int256 value, string dateType)
error InvalidDateValue(uint256 value, string dateType)
modifier paramsCheck(struct DateOperations.Date date)
It checks whether the parameters exceed the specified limits or not.
function toTimestamp(struct DateOperations.Date date) internal pure returns (uint256 unixTimestamp)
It converts the given date parameter to a Unix timestamp value.
Name | Type | Description |
---|---|---|
date | struct DateOperations.Date | The date that will be converted to a Unix timestamp value. |
Name | Type | Description |
---|---|---|
unixTimestamp | uint256 | The unix timestamp value of the given date. |
function toDate(uint256 unixTimestamp) internal pure returns (struct DateOperations.Date dates)