Jump to content

Recommended Posts

[quote author=lead2gold link=topic=111439.msg451652#msg451652 date=1160770976]
probably unix time.. it's the amount of seconds between now and Jan-1980.
[/quote]

just to correct on this point, a timestamp like this is the number of seconds passed since 12:00:00am, 1st Jan 1970.
A lttle help for you.

[code]

<?php

// Time is already a time stamp so echoing time you get the timestamp information.

$today=time();

echo "This is a timestamp from time $today";

// This is a timestamp from time but in human readable format.

$result2=date("d-m-y",$today);

echo " <br> This is a readable timestamp from time $result2";

// This is a date in a timestamp but in the date example you goto use the strtotime
//to convert the date to a timestamp.

$date_now=date("d-m-y");

$result_date=strtotime($date_now);

echo "<br> This is a date converted to a timestamp $result_date";

// This is date coverted from the timestamp from the $date-now in human readable conversion.

$date=date("y-m-d",$result_date);

echo "<br> This is a readable date from the strtotime function $date";

// please look up the date function on php.net there are meny settimgs for dates.


?>

[/code]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.