This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Webmaster forum > January 2007 > Need help understanding this format in php





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Need help understanding this format in php
Mike S.

2007-01-30, 9:59 am

I downloaded a free PHP ip tracker and I'm having trouble
understanding something.

When it logs the time of a visit it has the time as 1170009695 for
1:41 pm EST. What kind of time is that? It looks like it's in seconds.
I think I get the 9695 but I can't get the 117000. Could someone
please explain this to me? And is there a way to change the time into
a format that's easier to understand?

Rik

2007-01-30, 9:59 am

Mike S. <littleboyblu87@yahoo.com> wrote:

> I downloaded a free PHP ip tracker and I'm having trouble
> understanding something.
>
> When it logs the time of a visit it has the time as 1170009695 for
> 1:41 pm EST. What kind of time is that? It looks like it's in seconds.
> I think I get the 9695 but I can't get the 117000. Could someone
> please explain this to me? And is there a way to change the time into
> a format that's easier to understand?


Time since 1970-01-01 00:00:00
http://en.wikipedia.org/wiki/Unix_Time

<?php
date('r',1170009695);
?>
--
Rik Wasmus
Mike S.

2007-01-30, 9:59 am


Rik wrote:
> Mike S. <littleboyblu87@yahoo.com> wrote:
>
>
> Time since 1970-01-01 00:00:00
> http://en.wikipedia.org/wiki/Unix_Time
>
> <?php
> date('r',1170009695);
> ?>
> --




Now I have a headache.

Rik

2007-01-30, 9:59 am

Mike S. <littleboyblu87@yahoo.com> wrote:

>
> Rik wrote:
>
> Now I have a headache.


Hehe, don't worry about leap seconds and all that.
Just remember it's the number of second since 1970-01-01 00:00:00, and
most date/time funnctions in PHP require a timestamp. To display a more
userfriendly date you can use strftime() or date().
--
Rik Wasmus
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews