Epoch Convertor Users Guide
Click here to download your own copy. Requires Mysql.pm on a Unix Server
Click here to test the script
- Converting dates and timestamps
Epoch Converter requires the Mysql.pm Perl Module installed on a Unix or Linux server. And of course Perl.
Add your database connection details at the top of the epoch_converter.cgi script :
$DBHOST = "localhost";
$DBNAME = "databasename";
$DBUSER = "username";
$DBPASS = "password";
You can connect to any existing mysql database you like. The script does not store any data anywhere. it just needs to connect to mysql and send a query to it. Mysql will then process the query and return it's results.
You'll also find an offset variable. This needs to be set so that the returned time stamps and unix dates are returned as G.M.T. If your server is located in a time zone of GMT +1, you need to set the offset variable to 3600 seconds, which is 1 hour. If your server is located in a time zone of GMT -2, you need to set the offset variable to -7200 seconds, which is negative 2 hours. Once installed, you can then test your setting by entering "1" in the "Seconds to Epoch" field and the script should return January 1st, 1970 12:00:01 AM
Refer to our Script Installation FAQ if you run in to any problems. Here are the basic steps.
1) Upload epoch_converter.cgi in ASCII mode to your cgi-bin and CHMOD it to 755
2) Upload epoch_converter.html anywhere you like, but make sure the two forms in it point to the location of the epoch_converter.cgi script you uploaded
3) Load epoch_converter.html in a browser and test it.
Converting dates and timestamps
Simply enter a unix time stamp or select a date from the fields provided and press the relevant Submit button. Easy, fast, efficient and extremely accurate. That's what MySQL is.