Here are two simple functions that convert a given amount of seconds into REAL "human-readable" formats (i.e. 320 secs = '05 mins, 20 secs' OR '00:05:20')
These can help in effectively printing database records (or anything for that matter) returned in seconds only.
This function is used when your have Overseas server, let's say your server is on GMT-7 and your Local time is on GMT +7, then you want your script time to use your Local
(GMT+7) time.
Use this function to convert a mysql datetime field from the YYYY-MM-DD 00:00:00 format to the Seconds since Epoch and vise versa. Returns seconds since epoch and the datetime
Converts a user-entered date field into standard MySQL format. Also checks that the date entered is a valid date. Accepts mm/dd/yyyy, mm-dd-yyyy, yyyy/mm/dd, and yyyy-mm-dd
formats.
New and Improved! New function mysql_cvdate allows you to take a form-entered date value and express it in mysql's SQL date format. Also includes some real-life functions you
can call to perform common date/time conversions between MySQL datetime format, MySQL timestamp format and UNIX timestamp (i.e. seconds after epoch) with "human" output. Time
left function perfect for auction scripts, or where you need output of the difference between two supplied times.
Someone wanted to have a converter that took a "human" time and converted it to a MySQL timestamp. Use the function cvdate() to convert to a UNIX time stamp, then use
timestamp_to_mysql() (fount in the original mysql date/time converters article) to get the MySQL timestamp value. (Also check out strtotime() for a good english to timestamp
converter!)
Someone wanted to have a converter that took a "human" time and converted it to a MySQL timestamp. Use the function cvdate() to convert to a UNIX time stamp, then use
timestamp_to_mysql() (fount in the original mysql date/time converters article) to get the MySQL timestamp value. (Also check out strtotime() for a good english to timestamp
converter!)
This is the Easy way to Show a Dynamic Thai or English date on web page with user friendly styles such as "dd-mm-yyy" which will show Monday 13 August 2001. It's flexible for
define any syntax which you want . Try a syntax like "dd-mm-yyyy","help" to see inline usages.
I replaced the old code snippet with this simple class. This class (my first one, only for testing) is more flexible and can be used for date calculations. You need to
translate the week-days and month names in your local language. This is the last release because some simple PHP functions do the same job.
Convert server time to local time just use if your sever have different time with your place, sample you live in indonesia like me and your server is on US.
This is just like PHP's date() function, except it observes the user's time settings. Very useful if you want to have times customized for your users, depending on what
timezone they are in and whether they are observing DST/Summer Time.