php date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
YoussefSiblini
Forum Contributor
Posts: 206
Joined: Thu Jul 21, 2011 1:51 pm

php date

Post by YoussefSiblini »

Hi,
Is there a way to achieve this date below using php, I achieved this using this javascript code: new Date().valueOf(); but I need it in php;

Code: Select all

Required. Date and time of the 
purchase expressed as the number 
of milliseconds elapsed since
January 1, 1970 00:00:00 GMT.
For example, the TimeStamp for
00:00:00 GMT, 1st September
2003 is 1062374400000
.
Youssef
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php date

Post by Celauran »

Have you looked at microtime()?
YoussefSiblini
Forum Contributor
Posts: 206
Joined: Thu Jul 21, 2011 1:51 pm

Re: php date

Post by YoussefSiblini »

Thank you Celauran,
Can I achieve some thing like I mentioned above and here is more desc: TimeStamp – The window of opportunity for a valid TimeStamp is +/-1 hour from the based on the actual GMT time of submitting the Merchant POST.

?

Sorry I am still a newb with php.

Youssef
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php date

Post by Celauran »

microtime gives you seconds + microseconds. I'd concatenate the two and drop unneeded significant digits.
Post Reply