Hi All,
Below is a script from CaKiwi,
If I am reading a file that is dated 20041225 with Julian date 360, which uses the current year (2005) to determine if it is a leap year("date +'%Y'" | getline yy), and then returns the wrong date format which I understand why this is being done.
My question is , Is there a way to determine if the year should be 2004 instead of 2005?
split("31 29 31 30 31 30 31 31 30 31 30 31",m)
"date +'%Y'" | getline yy
mm = 1
while (dd > m[mm]) {
dd -= m[mm] mm++
}
printf ("%4.4d/%2.2d/%2.2d\n", yy, mm, dd)
}
Many Thanks
Chris
Below is a script from CaKiwi,
If I am reading a file that is dated 20041225 with Julian date 360, which uses the current year (2005) to determine if it is a leap year("date +'%Y'" | getline yy), and then returns the wrong date format which I understand why this is being done.
My question is , Is there a way to determine if the year should be 2004 instead of 2005?
split("31 29 31 30 31 30 31 31 30 31 30 31",m)
"date +'%Y'" | getline yy
mm = 1
while (dd > m[mm]) {
dd -= m[mm] mm++
}
printf ("%4.4d/%2.2d/%2.2d\n", yy, mm, dd)
}
Many Thanks
Chris