foo_podders:
First, big thanks to Aero, Otto, and all others involved in this fabulous plugin. I've been living without iTunes for a few months now, and have absolutely no regrets.
I thought I'd share my simple IPOD_LAST_PLAYED_TIME conversion TAGZ-script. Anyone using this will have to modify the variable 'gmtCorrection' for their appropriate timezone. Please fee free to modify/clean as you see fit.
#script 1
if (meta_test("IPOD_LAST_PLAYED_TIME"))
{
iPodTime = meta("IPOD_LAST_PLAYED_TIME");
secondsPerYear = 31557600;
secondsPerDay = 86400;
secondsPerHour = 3600;
gmtCorrection = -6 * secondsPerHour;
iPodTime += gmtCorrection;
years = iPodTime / secondsPerYear;
days = (iPodTime % secondsPerYear) / secondsPerDay;
hours = (iPodTime % secondsPerYear % secondsPerDay) / secondsPerHour;
minutes = (iPodTime % secondsPerYear % secondsPerDay % secondsPerHour) / 60;
seconds = (iPodTime % secondsPerYear % secondsPerDay % secondsPerHour % 60);
year = 1970 + years;
jan = 31;
if (year % 4 == 0)
{
feb = jan + 29;
}
else
{
feb = jan + 28;
}
mar = feb + 31;
apr = mar + 30;
may = apr +31;
jun = may + 30;
jul = jun + 31;
aug = jul + 31;
sep = aug + 30;
oct = sep + 31;
nov = oct +30;
month = 1;
day = days;
if (days > jan)
{
month = 2;
day = days - jan;
}
if (days > feb)
{
month = 3;
day = days - feb;
}
if (days > mar)
{
month = 4;
day = days - mar;
}
if (days > apr)
{
month = 5;
day = days - apr;
}
if (days > may)
{
month = 6;
day = days - may;
}
if (days > jun)
{
month = 7;
day = days - jun;
}
if (days > jul)
{
month = 8;
day = days - jul;
}
if (days > aug)
{
month = 9;
day = days - aug;
}
if (days > sep)
{
month = 10;
day = days- sep;
}
if (days > oct)
{
month = 11;
day = days - oct;
}
if (days > nov)
{
month = 12;
day = days - nov;
}
day++;
date = pad_left(year,4,"0") # "-" # pad_left(month, 2, "0") # "-" # pad_left(day, 2, "0");
time = pad_left(hours, 2, "0") # ":" # pad_left(minutes, 2, "0");
}
else
{
date = "";
time = "";
}
print(date # " " # time);
It's kinda ugly, but that's my solution given the limitations of TAGZ-script!