Question : Problems with date function PHP

Hi!

Have this code in my php-file

$timestamp = date("YmdHi");  

This return wrong Year, the year stored in $timestamp is 2020 ??
And it supose to return 2010.

What is wrong ???

Answer : Problems with date function PHP

CURRENT_TIMESTAMP() use the mysql function to avoid any dependency on language.

Hope this helps
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
$timestamp = date("YmdHi");
				//mysql_query('SET NAMES utf8');
				$sql = ("INSERT INTO singelsammen (timestamp,profileid, navn, adresse, post, fylke, mobil, epost, birthyear, yrke, interesser, barn, annet, medlemsnr, betaling) 
				VALUES (
				CURRENT_TIMESTAMP(),
				'".$insid."',
				'".$_POST["navn"]."',
				'".$_POST["adresse"]."',
				'".$_POST["postnrsted"]."',
				'".$_POST["fylke"]."',
				'".$_POST["mobil"]."',
				'".$_POST["epost"]."',
				'".$_POST["birthyear"]."',
				'".$_POST["yrke"]."',
				'".$_POST["interesser"]."',
				'".$_POST["barn"]."',
				'".$_POST["annet"]."',
				'".$medlemsnr."',
				'".$_POST["mod"]."'
				)");
				
					$result = mysql_query ($sql) or die (mysql_error());
Random Solutions  
 
programming4us programming4us