@@ -761,54 +761,6 @@ public static function format_address($data) {
761761 if (!$ addr ) return '' ;
762762 return $ addr .($ addr1 != '' ? ', ' .$ addr1 : '' ).', ' .$ city .', ' .($ county ? $ county .', ' : '' ).$ state .' ' .$ zip ;
763763 }
764-
765- /**
766- * format_datetime()
767- *
768- * @param mixed $format
769- * @param mixed $dt
770- * @return
771- */
772- public static function format_datetime ($ format , $ dt = "" ) {
773- $ date = new DateTime ($ dt );
774- return $ date ->format ($ format );
775- }
776-
777- public static function isvalid_datetime ($ format , $ dt ) {
778- $ dt = DateTime::createFromFormat ($ format , $ dt );
779- return $ dt !== false && !array_sum ($ dt ->getLastErrors ());
780- }
781- /**
782- * get_timestamp()
783- *
784- * @param string $dt
785- * @return
786- */
787- public static function get_timestamp ($ dt = "" ) {
788- $ date = new DateTime ($ dt );
789- return $ date ->getTimestamp ();
790- }
791- /**
792- * escape_sql_string()
793- *
794- * @param mixed $value
795- * @return
796- */
797- public static function escape_sql_string ($ value ) {
798- return addslashes ($ value );
799- }
800- /**
801- * escape_sql_array()
802- *
803- * @param mixed $array
804- * @return
805- */
806- public static function escape_sql_array ($ array ) {
807- foreach ($ array as $ key => $ value ) {
808- $ array [$ key ] = (is_string ($ value )) ? escape_sql_string ($ value ) : $ value ;
809- }
810- return $ array ;
811- }
812764 /**
813765 * time_in_words()
814766 *
@@ -817,7 +769,7 @@ public static function escape_sql_array($array) {
817769 */
818770 public static function time_in_words ($ date , $ with_time = true ) {
819771 if (!$ date ) return 'N/A ' ;
820- $ timestamp = get_timestamp ($ date );
772+ $ timestamp = strtotime ($ date );
821773 $ distance = (round (abs (time () - $ timestamp ) / 60 ));
822774
823775 if ($ distance <= 1 ) {
0 commit comments