|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Ok, I have some code that is covert a given date from the format "09/09/02" into a UNIX timestamp that will be stored in a MySQL database for later retrieval. The problem, though, is that it returns the date as December 31, 1969!
Could someone please help? PHP Code:
Thanks, ~Joe of 4Life ![]()
__________________
Check out 4Life today! |
|
#2
|
|||
|
|||
|
I believe that 09/09/02 should be 09/09/2002. Try that.
|
|
#3
|
|||
|
|||
|
Thanks, but same prob
![]() ~Joe |
|
#4
|
|||
|
|||
|
I tested the script on my server and it seemed to work fine
![]() |
|
#6
|
|||
|
|||
|
use the date function?
You can use symbols other than : in your date function, for example:
PHP Code:
|
|
#7
|
|||
|
|||
|
Hi,
What you have here works fine. I tried this out: PHP Code:
which gave the result: Quote:
Now, looking at your page you also have the timestamp as 1031544000 . This would suggest it's not the creating of the dates that's the problem, but how you're converting it to a date string. Move the .php file you linked to to a .phps file (if your web server is setup for those), so that we can see what you've got going on and try to help out a little more. Andy |
|
#8
|
|||
|
|||
|
Thanks! I'll try that code. Also, I changed it a PHPS file so that y'all can take a look at it....
~Joe |
|
#9
|
|||
|
|||
|
Yay, it works! How can I store this in a MySQL DB? Thanks!
|
|
#10
|
|||
|
|||
|
Ok, I got it!
PHP Code:
![]() Btw - I love talking to myself ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Timestamp Prob |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|