You are not logged in.

#1 2008-02-20 19:22:32

quezar
Member
Registered: 2008-02-20
Posts: 2

PHP help plz

I am doing a project for internship and I am completly new to PHP.  I am suppose to convert regular timestamp to unix time.  How do I do this? 

This is the HTML form.  How do I put the information I get and convert it into unix time.  I think I'm suppose to use the $_GET, but not sure.  Anyone have any sample code?

<html>
<body>

<table>
<tr>
<td>Please type in the date and time.</td>
</tr>
<tr>
<td><form action="converter.php" method="get">
    Month <input type="number" size="5" name="month">
    Day <input type="number" size="5" name="day">
    Year <input type="number" size="5" name="year">
    Hour <input type="number" size="5" name="hour">
    Minute <input type="number" size="5" name="minute">
    Second <input type="number" size="5" name="second">
</td>
</tr>
<tr>
<td><input type="submit" name="Submit">
</td>
</td>
</table>

</body>
</html>

Offline

#2 2008-02-20 22:01:00

[vEX]
Member
From: Sweden
Registered: 2006-11-23
Posts: 450

Re: PHP help plz

$_GET['month'] and so on, and feed it into mktime.


PC: Antec P182B | Asus P8Z77-V PRO | Intel i5 3570k | 16GB DDR3 | GeForce 450GTS | 4TB HDD | Pioneer BDR-207D | Asus Xonar DX | Altec Lansing CS21 | Eizo EV2736W-BK | Arch Linux x86_64
HTPC: Antec NSK2480 | ASUS M3A78-EM (AMD 780G) | AMD Athlon X3 425 | 8GB DDR2 | GeForce G210 | 2TB HDD | Arch Linux x86_64
Server: Raspberry Pi (model B) | 512MB RAM | 750GB HDD | Arch Linux ARM

Offline

Board footer

Powered by FluxBB