0

I am trying to make sense of the age of the battery (by calculating it from its manufacturing date). I need the information for something I am working on and need to know how to access it programmatically.

Normally, it was easy to do this as described here. But since Big Sur, this five-digit integer has changed to something totally unrecognizable. I found this single link detailing it, and that person had issues explaining what it actually meant and how to extract the manufacturing date from it.

I was not able to find the spec sheet to figure out what Apple means with this number too, so if anyone has any information, it would be uber useful. Thank you. :)

If it matters, I am currently extracting this information using

ioreg -l -n AppleSmartBattery -r | grep -e \"ManufactureDate\" \
    | awk -F',' '{printf ("%s", $56)}' | awk -F'=' '{printf ("%i", $2)}'
0

1 Answer 1

2

Instead of looking at the ManufactureDate, you should instead look at the battery serial number. It can be retrieved with the same command:

ioreg -l -n AppleSmartBattery -r

In the output you'll find something similar to this:

"BatterySerialNumber" = "12345678901234567"

You need to look at only the characters at index 4-7 in the serial number according to this template:

"BatterySerialNumber" = "---YWWD----------"

The meaning here is Y=Year, W=Week, D=Day.

For example, your serial number contains "9214" this means that your battery was manufactured in 2019, week 21, day 4 of the week - that is the 24th of May 2019.

1
  • Thank you for that information. I did read somewhere that the information was embedded in the serial, but with Apple's plans of randomizing serials, won't it become problematic to depend on extracting it from here? I will use this for now, and will cross that bridge when we get to it. :)
    – adwaraki
    May 6 at 22:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .