Sublime directory Surf the web anonymous Pagerank Monitor


convert standard time to php time()

Meth0d
Tue 8 May 2007, 08:36 am GMT +0200
for example, i say i have a date that is formatted in some data like so:

Quote
05/07/2007 20:15:00

is it possible with PHP, or some script or function that has already been written by a php King like nikolas  ;D, to convert that time automatically to what php function.time will return? such as the above being:

Quote
1162165466

Please note for this example, the 2 dates shown in both formats are not identical or of equal value. The 2nd one is just randomly pressed keys that "looks" like what the php function.time returns.

This would of course be the same as just using date("M/D/Y H:M:S") or whatever it may be, but doing it "backwards" in a way, like what i wanted from the substr function before  :P

olaf
Tue 8 May 2007, 08:41 am GMT +0200
and what is your question?

Nikolas
Tue 8 May 2007, 08:43 am GMT +0200
A php king, lol :P

To do this you will have to parse the date you have and pass it to mktime()

Meth0d
Tue 8 May 2007, 06:53 pm GMT +0200
ah, so there IS already a function that does this, after reading the manual from php.net i cant believe i didnt notice this before :P thanks again Nik!, this is precisely what i was looking for.

olaf
Tue 8 May 2007, 07:24 pm GMT +0200
ah, so there IS already a function that does this, after reading the manual from php.net i cant believe i didnt notice this before :P thanks again Nik!, this is precisely what i was looking for.

yes there is a list of related functions in the left side bar...

Meth0d
Tue 8 May 2007, 07:25 pm GMT +0200
ah, so there IS already a function that does this, after reading the manual from php.net i cant believe i didnt notice this before :P thanks again Nik!, this is precisely what i was looking for.

yes there is a list of related functions in the left side bar...

i did not know Webdigity had its own clean version of the php.net manual Olaf, until i posted this thread.. but now i do :) and use it alot

olaf
Tue 8 May 2007, 07:30 pm GMT +0200


i did not know Webdigity had its own clean version of the php.net manual Olaf, until i posted this thread.. but now i do :) and use it alot

my comment was not about the php manual on webdigity, but about how to use the php manual in general. If you read about some function you have always links related functions on the same page.

I read the manual every day and there is every week some new function I never saw before (I know only 20-40 functions with all the arguments)

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional