1
0
mirror of https://github.com/fspc/Yellow-Bike-Database.git synced 2025-02-22 08:53:23 -05:00

This closes #25!

* Requires mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
This commit is contained in:
Jonathan Rosenbaum 2017-11-13 00:38:01 +00:00
parent 68061f3408
commit 104de44dc5

View File

@ -477,6 +477,17 @@ function currency_format($value, $places = 2){
echo "$ ";
if(is_null($value)) echo number_format(0,$places);
else echo number_format($value,$places);
}
// function to set time zone in mysql.
// Time zones must be setup in mysql for this to work: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
set_time_zone();
function set_time_zone() {
global $database_YBDB, $YBDB;
mysql_select_db($database_YBDB, $YBDB);
$query = "SET time_zone='" . TIMEZONE . "';";
$Recordset1 = mysql_query($query, $YBDB) or die(mysql_error());
}
//function to convert server time to local time. To be used by all other current date / time requests.