Zend - The PHP Company




Conversion

Add Code


Convert numbers to words for money  

Type: code fragment
Added by: petermac
Entered: 23/11/2005
Last modified: 09/12/2008
Rating: *** (3 votes)
Views: 7582
When changing from money numbers to words (as in writing out a cheque). I am not the original author, but this is valuable, so I include it here.


convert numbers to words with part of curncy  

Type: application
Added by: sowa7
Entered: 30/09/2006
Last modified: 07/12/2006
Rating: - (fewer than 3 votes)
Views: 2927
this code is orginaly coding by 'petermac' But i add Cents to this code


Convert Seconds to Friendly String  

Type: code fragment
Added by: bigret
Entered: 08/05/2004
Last modified: 05/12/2003
Rating: - (fewer than 3 votes)
Views: 6414

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.



ConvGMT  

Type: code fragment
Added by: hermawan
Entered: 03/11/2002
Last modified: 01/11/2001
Rating: - (fewer than 3 votes)
Views: 5594
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.


datetime conversion  

Type: code fragment
Added by: Peppe316
Entered: 15/04/2001
Last modified: 04/12/2000
Rating: - (fewer than 3 votes)
Views: 15025
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


Discordian Date  

Type: application
Added by: nsheridan
Entered: 15/05/2002
Last modified: 05/12/2001
Rating: - (fewer than 3 votes)
Views: 4515
Five tons of flax


myDate  

Type: class
Added by: dunxd
Entered: 25/03/2004
Last modified: 05/12/2003
Rating: - (fewer than 3 votes)
Views: 8528
Added in RFC822 valid date format, suitable for RSS feeds.


MySQL Date Validation and Convertion  

Type: code fragment
Added by: esammons
Entered: 18/09/2001
Last modified: 09/12/2000
Rating: ***** (3 votes)
Views: 18282
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.


mysql date/time converters  

Type: code fragment
Added by: woodys
Entered: 13/06/2000
Last modified: 09/12/2000
Rating: ***** (10 votes)
Views: 20527
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.


mysql date/time converters, part II  

Type: code fragment
Added by: woodys
Entered: 26/09/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 7490
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!)


mysql date/time converters, part II  

Type: code fragment
Added by: woodys
Entered: 26/09/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 6636
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!)


newTDConv  

Type: class
Added by: magnums
Entered: 23/08/2001
Last modified: 08/12/2000
Rating: - (fewer than 3 votes)
Views: 6308
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.


PHP Local date  

Type: class
Added by: olaflederer
Entered: 11/01/2005
Last modified: 01/12/2004
Rating: - (fewer than 3 votes)
Views: 3983
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.


rfcdate  

Type: code fragment
Added by: fwancho
Entered: 02/10/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 5546
Generates a fully-compliant RFC 822 date string, including correct timezone offset.


sec2HMS  

Type: code fragment
Added by: Scott_Sinclair
Entered: 29/04/2000
Last modified: 02/12/2000
Rating: - (fewer than 3 votes)
Views: 6406
This code converts int seconds to a nice Hours:Minutes:Seconds output


Set to my local time  

Type: code fragment
Added by: idban
Entered: 03/03/2000
Last modified: 07/12/2001
Rating: **** (7 votes)
Views: 10816
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.


timestamp_db_php  

Type: code fragment
Added by: chrisshaffer
Entered: 12/12/2002
Last modified: 02/11/2001
Rating: - (fewer than 3 votes)
Views: 6586
Takes a MySQL formated timestamp value (YYYYMMDDhhmmss) and converts it to a humman readable date using the date() function.


User's Real Time  

Type: code fragment
Added by: j_freeman
Entered: 20/10/2006
Last modified: 02/11/2005
Rating: - (fewer than 3 votes)
Views: 2829
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.



Search



This Category All Categories