Convert epoch time to human readable time

Hello,
I have difficulties to convert epoch timestamps like this 1740819745000
to a human readable date like this Saturday, March 1, 2025 9:02:25 AM
It works with reasoning models but not with the other one.
Do you have a solution for this?
Regards

Don’t try to use a language model as a calculator.

You can do this conversion yourself like this in a JavaScript console,

Date(1740819745000).toLocaleString();

Or using Python like this,

def convert_epoch(ms):
    return datetime.fromtimestamp(ms / 1000).strftime('%Y-%m-%d %H:%M:%S')

If you need 4o to be able to do it for some reason, give it the function to convert from epoch time to human readable time and all it to use it.

5 Likes

Its bad that the AI is not even capable of doing it… It gets it wrong often so its really relatively intelligent

1 Like

I mean, can you do it? I can’t.

The two most important distinctions between us and the rest of the animals on this planet is our use of language and our ability to use diverse tools.

So, just as I would never expect a human to be able to convert an epoch timestamp into something human-readable (there’s a hint right there) I wouldn’t expect a large language model to be able to do so either. It has nothing to do with intelligence.

Now, what would be intelligent is if the model, when finding itself in a situation where it needed to convert epoch times, on the fly built and used a tool to do the conversions.

Even better would be if, whenever it needed to do something outside the scope of its native abilities it built a tool to help itself out and kept a repository of tools it had made to reuse in the future.

Then, as the models improve, they could review their own tools, discarding those which are no longer necessary or improving upon those they use often.

At least this was my initial thoughts when the whole “how many rs are there in strawberry” thing was going around.

Just like humans with different abilities and disabilities build up support structures around themselves to enable them to function better in the world, the models should be enabled to build their own scaffolding.

Imagine if there were a version of the model combing through old ChatGPT messages, finding common issues in the model’s ability, drafting tools and tool documentation and updating the model’s tool repository accordingly.

Then, you could have a small message understanding model parse the content of a user message and either suggest the model look for tools or even suggest specific tools the model might want to employ to assist in its response. Similar to the thinking step for reasoning models.

The tldr is that expecting a language model which predicts the next token in a sequence to be able to convert epoch timestamps just isn’t realistic and being frustrated by it is pointless. You wouldn’t get mad if the orange juice you tried to make in your coffee maker didn’t turn out, would you?