15 lines
335 B
Python
15 lines
335 B
Python
from fastapi import APIRouter
|
|
|
|
from time_app.helpers.datetime import real_utc_now
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get('/', name='Now')
|
|
def now_view() -> str:
|
|
return real_utc_now().strftime('%Y-%m-%d %H:%M:%S')
|
|
|
|
|
|
@router.get('/diy', name='Day in year')
|
|
def day_in_year_view() -> str:
|
|
return real_utc_now().strftime('%y%j')[-4:]
|