Everybody Staze...

Nobody leavz...

  • Home
  • About Me
    • LinkedIn
    • Lab
  • Contact
  • Links
  • Reviews
  • Sitemap
  • Weather

Decoding Apple Serial Numbers for Date of Manufacture

2016/03/30 By staze

At work, I’ve been heading up an Asset Management project. Inventorying everything we have, adding it to a system, and then figuring out replacement cycles, amortization, etc. Part of this has been figuring out purchase dates for things like Macs, without asking our overloaded accounting office for invoices for a couple hundred machines.

Some investigation led me to two websites, one covering the new serial numbers, and the other covering older serial numbers. Basically, they used to be very readable with numbers representing their actual numbers. Then Apple switched to using Base-27 to represent year (first or second half), and then week was similar (using a limited set of letters and numbers).

Using that information, I’ve created the following script (yes, it’s pretty ugly PHP) that should decode both old 11 digit serials, and new 12 digit ones. Because of my use case, it adds some time to the manufacturing date to come up with a reasonable “purchase date” that I then use ((in my case, it just figures the purchase date was the start of the term following manufacture)). Feel free to use, modify, etc. I just built this because the sites that actually give manufacture date usually have limits on the number of queries per hour/day etc.

Thanks!


‘2005-1’,
‘1’ => ‘2005-2’,
‘2’ => ‘2006-1’,
‘3’ => ‘2006-2’,
‘4’ => ‘2007-1’,
‘5’ => ‘2007-2’,
‘7’ => ‘2008-2’,
‘8’ => ‘2009-1’,
‘9’ => ‘2009-2’,
‘C’ => ‘2010-1’,
‘D’ => ‘2010-2’,
‘F’ => ‘2011-1’,
‘G’ => ‘2011-2’,
‘H’ => ‘2012-1’,
‘J’ => ‘2012-2’,
‘K’ => ‘2013-1’,
‘L’ => ‘2013-2’,
‘M’ => ‘2014-1’,
‘N’ => ‘2014-2’,
‘P’ => ‘2015-1’,
‘Q’ => ‘2015-2’,
‘R’ => ‘2016-1’,
‘S’ => ‘2016-2’,
‘T’ => ‘2017-1’,
‘V’ => ‘2017-2’,
‘W’ => ‘2018-1’,
‘X’ => ‘2018-2’,
‘Y’ => ‘2019-1’,
‘Z’ => ‘2019-2’
);

//Years for 11 digit serial. Yes, it ignores the year 2000 and before.

$years11 = array(
‘0’ => ‘2010’,
‘1’ => ‘2001’,
‘2’ => ‘2002’,
‘3’ => ‘2003’,
‘4’ => ‘2004’,
‘5’ => ‘2005’,
‘6’ => ‘2006’,
‘7’ => ‘2007’,
‘8’ => ‘2008’,
‘9’ => ‘2009’,
);

//Week is the next digit following year, specifying weeks 1 through 26.
//Weeks 27 through 52 are designated by the “half” of the year specified above.

$weeks = array(
‘1’ => ‘1’,
‘2’ => ‘2’,
‘3’ => ‘3’,
‘4’ => ‘4’,
‘5’ => ‘5’,
‘6’ => ‘6’,
‘7’ => ‘7’,
‘8’ => ‘8’,
‘9’ => ‘9’,
‘C’ => ’10’,
‘D’ => ’11’,
‘F’ => ’12’,
‘G’ => ’13’,
‘H’ => ’14’,
‘J’ => ’15’,
‘K’ => ’16’,
‘L’ => ’17’,
‘M’ => ’18’,
‘N’ => ’19’,
‘P’ => ’20’,
‘Q’ => ’21’,
‘R’ => ’22’,
‘T’ => ’23’,
‘V’ => ’24’,
‘W’ => ’25’,
‘X’ => ’26’
);

$monthsdays = array(
4 => ’10/01′,
1 => ’01/05′,
2 => ’04/01′,
3 => ’06/20′,
);

$serial = $_GET[‘s’];
$serial = trim(preg_replace(‘/\s+/’, ”, $serial));
$serial_length = strlen($serial);

$output = $_GET[‘o’];
$output = trim(preg_replace(‘/\s+/’, ”, $output));

if ($serial_length == 11) {
//echo “Computer Pre-2012
“;
$year = substr($serial, 2, 1);
$week = substr($serial, 3, 2);
$purchase_year = $years11[$year];
$purchase_week = $week;
} elseif ($serial_length == 12) {
//echo “Computer Post-2012
“;
$year = substr($serial, 3, 1);
$week = substr($serial, 4, 1);
$purchase_year = $years[$year];
$purchase_week = $weeks[$week];
} else {
die(“Nothing to do!”);
}

if(substr($purchase_year, -2,2) == ‘-2′) {
$purchase_week = $purchase_week + 26;
}

$purchase_year = substr($purchase_year, 0, 4);

if ($purchase_week > 36) {
$purchase_term = 1;
$purchase_year++;
} else {
$purchase_term = ceil($purchase_week/12);
}

$purchase_date = $monthsdays[$purchase_term] . “/” . $purchase_year;

if ($output==’csv’) {
echo $serial . ‘,’ . $purchase_date . “\n”;
} elseif ($output==’date’) {
echo $purchase_date . “\n”;
} else {
echo “Manufacture Year: ” . $years[$year] . ” Manufacture Week: ” . $weeks[$week] . “
“;
echo “Year: ” . $purchase_year . ” Term: ” . $purchase_term . ” Purchase Date: ” . $purchase_date;
}

?>

Filed Under: Apple Tagged With: Apple, PHP, Serial Numbers

Repairing Trimble Thunderbolt GPSDO

2016/03/30 By staze

ThBltOpnMy quest for a solid 10Mhz signal finally took it’s penultimate step recently, when I purchased a Trimble Thunderbolt GPSDO off eBay.

The unit arrived packed well, and in good shape. It even came with a power connector, which I had not expected. After rewiring it properly (it seemed “off”), I hooked up my Rigol DP832 for the ±12V supplies, and +5V supply, and powered the unit up. Everything looked okay except the +5V rail was drawing about 3x what it should. Oh, and the 10Mhz output being “out” by +26Hz (I wondered if this was because the unit was still powering up, so it didn’t bother disciplining the oscillator yet).

Hooking up a serial connection got no output, and probing the serial connection with the scope showed very low level signals (less than 1Vpp). Opening the unit, I found that the RS232 transceiver (a 232IBE, which is now called a ICL232, or any other number of MAX232 derivatives) was HOT. Everything else looked good for the unit, so my assumption is the chip was damaged. I clipped the leads and replaced the chip with a MAX202 made by TI. It’s pin compatible, but has much better tolerance for ESD and Latch-up (which seemed to be what was going on with the failed chip).

[Read more…]

Filed Under: Electronics Tagged With: GPSDO, Trimble Thunderbolt

Fallout 4

2016/02/08 By staze

fallout-two-column-01-ps4I, like the rest of the Fallout fans in the world, pre-ordered Fallout 4 (PS4) so I could get it on release day. I made a point to finish up Farcry 4 before starting Fallout, and then went headlong into the game… and after beating it a couple weeks back, and having time to reflect, I have to say… I’m disappointed. Fallout 3 was a great re-imagining of Fallout in a first person shooter. The story was good, and the gameplay was good, albeit a bit “dark” (as in, there was a lot of wandering around in areas that were too dark to see what was going on). New Vegas fixed a lot of that, and gave the game a lot of depth when it came to options. You could talk your way out of things, sneak around things, etc. Fallout 4 undid, almost all of that. You were, basically, Arnold Schwartzenegger, out to get revenge… and would kill anyone that got in your way. Which means, yes, you basically had to kill everyone. Key points in the game required killing. Whether you did it, or glitched the game into NPCs doing it, or whatever: certain people had to die. And that seems like a step backward. Fallout has always had choices. Big ones, small ones, etc. From picking SPECIAL stats, to perks, etc. So with this, the game felt very open, and yet linear. Go here, kill this guy, go here, join this faction, go here, kill this other faction, etc etc. It just seemed, sloppy.

Now, don’t get me wrong, the game was enjoyable. And the story was enjoyable (albeit, oddly close to home since my son shares the name of the protagonist’s). And they did a good job of making the factions “real”. Albeit, they may have made the Brotherhood a bit TOO asshole-ish for my tastes (though, in Fallout, and Fallout 2, they were complete jerks). The game is also really pretty, and even though everyone was complaining shortly after release, I had ZERO issues with crashing (well, almost zero, I think the game crashed on me a total of 2 times in over 80 hours of gameplay). And unlike New Vegas, there were never any game breaking bugs. So really, I’m looking forward to the DLC to see if they address any of these shortcomings. Because right now, I’m very conflicted about the game. It’s enjoyable, and it’s fun, but it’s not replay-able at all, in my mind. And the ending… seriously disappointing (just, uninteresting, phoned in, bleh).

All that said, at this point, I’m going to give the game a reasonable score. It’s fun, pretty, and enjoyable to play. But when you’re done, it just leaves you asking “What did I just play?” I know everyone said Fallout 3 was Elder Scrolls with guns. And that Skyrim was Fallout with magic. But Fallout 4, to me, felt a lot like what people complained about with Skyrim. Go kill this dragon… now do it again 15 f’ing times!

Here’s hoping the DLC improves things, or Doom is a better showing… because it would seem the Bethesda Fallout “team” is straight out of ideas.

[xrr rating=3.5/5]

Filed Under: Reviews Tagged With: Bethesda, Fallout 4, Playstation 4

« Previous Page
Next Page »

Weather

Categories / Archives

  • Apple
  • Coding
  • Electronics
  • Energy
  • Home Ownership
  • Miscellany
  • Politics
  • Prius
  • Sys Admin
  • Travel
  • Uncategorized
  • Work
  • June 2026
  • April 2026
  • August 2025
  • April 2025
  • January 2024
  • February 2021
  • July 2020
  • January 2020
  • April 2019
  • March 2018
  • February 2018
  • June 2017

Copyright © 2026 · Staze On Genesis Framework · WordPress · Log in