How can i change the timestamp ?

Discussion corner for Developers of Serendipity.
Post Reply
jan1207
Posts: 2
Joined: Mon Aug 15, 2011 8:54 am

How can i change the timestamp ?

Post by jan1207 »

sorry if my english is not so good.


I use the program for something totaly different then where it is made for.
But is fulfilled all of the things i need.
I used the program to colect al the events in my life.
With al the paper's writen and recived, All the payments i have done the music that i have heard at special times, and pieces of my own movie's i have made.
On this way i can get a total timeline ( lifeline).
From all the software i have tested is this the only program where i can colect everything.
There is at this moment not a program what can help to make a complete timeline with al events.

The only problem now is the timestamp.
Now the program is working with the unix time.
But the first papers and event is have is from before 1 january 1970.

Can someone tell me how i can change this or with files i need to edit ?

Thank you

Jan
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: How can i change the timestamp ?

Post by Timbalu »

I dont think this is easy to to. You digital life copy would better stop in 1970 with a first entry pointing to one or more static pages, or another little program which can handle dates beyond 1970. This could be included in serendipity too.

There are workaround the unix limitations out there...., like:
PHP native date functions use integer timestamps for computations. Because of this, dates are restricted to the years 1901-2038 on Unix and 1970-2038 on Windows due to integer overflow for dates beyond those years. The ADOdb Date Time Library overcomes these limitations by replacing the native function's signed integers (normally 32-bits) with PHP floating point numbers (normally 64-bits).
http://phplens.com/phpeverywhere/node/view/16

It will then make some work and needs some knowlegde to find all mktimes and all set timestamp calls in serendipity to convert them to the new function. I am even not sure if the mysql timestamp field would take these new timestamps without problems..., but I think it might be better not to try this in serendipity itself.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How can i change the timestamp ?

Post by garvinhicking »

Hi!

I have not tried this personally, but I think recent PHP versions are able to handle negative unix timestamps properly. So if you can alter the serendipity_entries timestamp from UNSIGNED to SIGNED, this should allow the database table to hold negative values, and with those you should be able to collect dates before 1970...in theory...are you willing to try along? :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jan1207
Posts: 2
Joined: Mon Aug 15, 2011 8:54 am

Re: How can i change the timestamp ?

Post by jan1207 »

Hello Garvin,

I have changed the setting from the serendipity_entries timestamp and tested it with 200 articles.
Now i can collect dates before 1970 even from 1935.
I also changed the setting with a loaded database and then i can add also dates from before 1970.

Thank you for the solutions

Jan
Post Reply