# API doesn't know date, thinks it's 2022

**URL:** <https://community.openai.com/t/api-doesnt-know-date-thinks-its-2022/569125>\
**Category:** Bugs\
**Created:** [December 22, 2023, 9:38pm UTC](https://community.openai.com/t/api-doesnt-know-date-thinks-its-2022/569125 "2023-12-22T21:38:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dignity\_for\_all](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/dignity_for_all/32/300058_2.png) [@dignity\_for\_all](https://community.openai.com/u/dignity_for_all)\
**Post date:** [December 22, 2023, 10:28pm UTC](https://community.openai.com/t/api-doesnt-know-date-thinks-its-2022/569125/4 "2023-12-22T22:28:12Z")

</div>

In that case, you can add the following to the API’s system messages

```auto
import datetime
import pytz

your_locale = pytz.timezone('Your locale goes here')
datetime = datetime.datetime.now(your_locale)
            now_of_year = datetime.strftime("%Y")
            now_of_month = datetime.strftime("%m")
            now_of_day = datetime.strftime("%d")
            now_of_time = datetime.strftime("%H:%M")
            system_message_content = f"Today is the year {now_of_year}, month is {now_of_month}, and date is " \
                                          f"{now_of_day}. " \
                                          f"The current time is {now_of_time}. "

```

Alternatively, you can indicate the current date.

```auto
Current date is: {datetime goes here}

```

In ChatGPT, there may be some information or prompts about knowledge cutoffs that is not visible to the user, but you need to make it explicit if you want to use the API.

I hope this will be of some help to you.

---

_[View the full topic](https://community.openai.com/t/api-doesnt-know-date-thinks-its-2022/569125)._
