Ответы пользователя по тегу Работа с датой/временем
  • Как декодировать uint256?

    @KoldunOne
    Руководитель
    const lockEndTime = '1701243077';

    const date = new Date(lockEndTime * 1000);
    const year = date.getFullYear();
    const month = ('0' + (date.getMonth() + 1)).slice(-2);
    const day = ('0' + date.getDate()).slice(-2);
    const hours = ('0' + date.getHours()).slice(-2);
    const minutes = ('0' + date.getMinutes()).slice(-2);
    const seconds = ('0' + date.getSeconds()).slice(-2);

    const formattedDate = `${day}.${month}.${year}`;
    const formattedTime = `${hours}:${minutes}:${seconds}`;

    console.log(`Дата: ${formattedDate}`);
    console.log(`Время: ${formattedTime}`);
    Ответ написан
    Комментировать