Jump to content


Photo

PHP Date stamp question...


  • Please log in to reply
7 replies to this topic

#1 All4172

All4172
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 14 July 2006 - 03:27 AM

I'm trying to recreate the following in PHP DATE but unsure of what the entire stamp on the end is:

2006071310505

2006 = Year
07    = July
13    = Day in month
10505 = ?????????

Any ideas of what the 5 digit code on the end is?

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 14 July 2006 - 03:28 AM

Where did you get this number?

Ken

#3 All4172

All4172
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 14 July 2006 - 03:35 AM

Its some sort of a date stamp that is used to tag article files.  I'm attempting to reproduce it within a PHP script but don't have access to seeing how the original date stamp is done.

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 14 July 2006 - 03:40 AM

Do you have any other clues. Is it used in any displays where it is formatted. Do you have anymore examples of the number? Those remaining 5 digits could be just a id tacked on for other purposes. Without more examples, I don't think we can give you an exact answer.

Ken

#5 All4172

All4172
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 14 July 2006 - 03:48 AM

Well best clue I have is this here:

2006070710348

From the Article date itself it appear to be created at 3:48 in the afternoon....and I "think" that when its 10348 that equals 3:48 PM, and if its 00348 that would equal 3:48 AM.  At least that's the best I can come up with.

#6 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 14 July 2006 - 03:54 AM

thats the timing i dont know exactly what it is but heres how i decode it

<?php
$datefromdb = $row['table_row'];
$year = substr($datefromdb,0,4);
$mon  = substr($datefromdb,4,2);
$day  = substr($datefromdb,6,2);
$hour = substr($datefromdb,8,2);
$hour = $hour - 5;
$min  = substr($datefromdb,10,2);
$sec  = substr($datefromdb,12,2);
$time = date("l F dS, Y h:i A",mktime($hour,$min,$sec,$mon,$day,$year));

//then u could display the $time

echo ("$time")
?>
after this it comes out like this

Thursday July 13th, 2006 04:42 PM

#7 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 14 July 2006 - 03:56 AM

oh and the -5 is for GMT - 5

did this help?

#8 All4172

All4172
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 14 July 2006 - 05:57 AM

Yes thanks for the help :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users