Tutorial

Timestamp 1970 1969

Timestamp is very important for the Business Suite and other accounting application. Years and months are commonly used to create the directories for data records.

The strtotime() function in PHP is used to parse a date and time string into a Unix timestamp, and if an empty string is passed as its argument, it returns false. When you use date("Ymd", strtotime("")), strtotime("") returns false, which is then interpreted as 0 when used in a date function.

The Unix timestamp 0 corresponds to January 1, 1970, 00:00:00 UTC. However, when you adjust for time zones (if your server or environment is set to a negative UTC offset, such as UTC-5 or similar), this timestamp could display as December 31, 1969.

Webpage generated from the code.

When in blank page, Click the following button to open a new window to see the error page.

Error log file.

This file consists of the error messages generated by the webpage. The lastest message is at the bottom.

Error log has been successfully copied to the text file.
Functions used in this webpage:

PHP

PHP strtotime() Function
PHP date() Function
PHP echo() Function
ChatGPT

This totuorial using the company profile accounting month as example.

If clear the accounting month, the system will detect the month as 1969 or 1970. This will affect the creation of the data directory back dated to those years. More check condition needed to prevent this from happening.

Coding area: