Years before 1902

Hi, don’t kwow why but it seems I can’t use andy date before 01/01/1902. When I save the post, the year is automatically set to 1970. Any hint?

Thank you

I don’t know how Kirby handles timestamp internally, but the reason for the default jumping back to 1970 is because january 1st 1970 is the Unix timestamp epoch. To get the years before 1970, you need to work with negative timestamps. You’ll need something in the ballpark of -2140306013

How are you saving the dates? Which format?

You mean, it doesn’t display correctly in the Panel? What is your Kirby version? I can’t reproduce this in 2.5.9. Have you tested this in a fresh Starterkit?

Maybe you use it the “wrong” way? No page can be created 1902. Kirby was not yet born.

Add a datetime field instead?

What is that? April Fool’s Day?

What do you mean? Can you create files with a date before 1970?

Of course I can have a date in the past, for example birthdays or publication date of books etc. My date doesn’t have to be a post publication date.

With a field you can have older dates, but not on pages. In the question he says that it jumps back to 1970, which sounds like a file issue.

@hvsrmusic To make it clear, is it the date of the file or a date in a field?

1 Like