Yet another years api.
Say Goodbye to Outdated Footer Years, Forever.
Every January 1st, trillions of web developers face the crisis: outdated copyright years.
With the help of this API, developers can easily access current date and time information, including year information and time with timezone support.
API Usage
Get Current Date
GET https://datetime.fyi/api/v1/date
Returns current date information in multiple formats
{
"year": 2025,
"year_string": "2025",
"month": 1,
"month_string": "January",
"day": 12,
"day_string": "12",
"british_format": "12-Jan-2025",
"us_format": "Jan-12-2025"
}
Get Current DateTime
GET https://datetime.fyi/api/v1/datetime
Returns current date and time with timestamps
{
"datetime": "2025-01-12 13:20:10 CST",
"unix_timestamp": 1736760010,
"iso8601": "2025-01-12T13:20:10+0800",
"rfc3339": "2025-01-12T13:20:10+08:00"
}
Get Year Information
GET https://datetime.fyi/api/v1/year
Returns current year information including Chinese zodiac
{
"year": 2025,
"is_leap_year": false,
"year_string": "2025",
"chinese_zodiac": "Snake"
}
Get Time with Timezone
GET https://datetime.fyi/api/v1/time?zone=Asia/Tokyo
Returns current time in specified timezone
{
"time": "14:20:10",
"timezone": "Asia/Tokyo"
}
Solution in 2025
const dateTime = new Date();
console.log(dateTime.getFullYear());