|
|
|
Sometimes you need to convert dates that come from forms or other input options that you have no
control over. For example,
you may receive a date as : 1-Dec-1970'.
One way to go is to use the date() and strtotime() functions :
<?
date("Y-m-d",strtotime("1-Dec-1970"));
?>
The output will be : 1970-12-01
|
|
| Finding the day of the week for a specific date.
Categories : PHP, Databases, MySQL, Date Time | | | mysql date/time converters Categories : PHP, MySQL, Databases, Date Time | | | Data Retrieve from Mysql using AJAX with PHP Categories : PHP, AJAX, Date Time, Databases, MySQL | | | Phorum, MySQL, Language, UK date format, MySQL UK Date format Categories : PHP, Date Time, Strings, MySQL, Databases | | | List people whose birthdays fall on the current Day and Month
Categories : Databases, Date Time, MySQL, PHP | | | This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | Simple function to return the number of days in a time span between 2 given dates. Categories : PHP, Date Time, MySQL, Databases | | | In Mysql, the 'datetime' data type is used to store date that looks like '2007-10-16 16:26:30'. we are going to design a function called mysqldate() that takes a mysql date and output format as input and outputs a well formated date. Categories : PHP, Date Time, Databases, MySQL | | | Checks Date-Input from HTML-Forms and converts to YYYY-MM-DD Format for MySQL Date-Fields Categories : MySQL, Date Time, PHP, Databases | | | How to Convert a MySQL Timestamp to a USA Date & Time Categories : PHP, MySQL, Databases, Date Time | | | Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP, Arrays, Date Time, Databases, MySQL | | | Count how many weeks in the month have a specified day, such as Mon, Tue, etc. Var avail - number of days - first day name of the month, occurrences of Sun, occurrences of Mon, etc. Allows you to calculate number of working hours exclude Holidays. Categories : Calendar, Date Time, PHP, Databases, MySQL | | | How to Insert a Date Format Into MySQL from PHP Categories : PHP, Databases, MySQL, Date Time, Beginner Guides | | | bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager Categories : MySQL, PHP, MySQL, Complete Programs, Databases | | | formating MySQL Timestamp to get a propper Output.
related : Timestamp, ereg_replace, mysql, substr Categories : MySQL, PHP, Date Time, Databases | |
| | | | Thomas Miranda wrote : 1017
To say the truth, there is a more easy way, that is to explode and after implode the variable that holds the data. example:
$var_data = date("Y-m-d");
$data = implode(`/`, array_reverse(explode(`-`, $var_data)));
A big brazilian hugs :)
hope it help.
can we create a function with this? if yes, send to my email please, i was trying but not sucess with the return.
| | | | Strong Yuan wrote : 1019
mysql_query("select date_format(cr_date,\"$Y-d-m\")as date...
| | | | Strong Yuan wrote :1020
mysql_query("select date_format(cr_date,\"%Y-%d-%m\")as date...
| |
|
|
|