I am writing a bash script to look for a file which's **file name** is most recently and file name like:

```
...
Wed_Dec_30_16:47:41_PHT_2015.zip
Wed_Dec_30_16:00:41_PHT_2015.zip
Wed_Dec_30_16:00:41_PHT_2015.zip
Thu_Dec_31_16:49:14_PHT_2015.zip
...

```

I'm search all .zip file use `find` command and i thought maybe i need a array like:

```
readarray -t lines <<< "$(find . -type f -name '*.zip' -exec basename {} \;|tr -d '[.zip]'|tr '_' ' ')"
len=${#lines[@]}
for ((i=0;i<len;i++)); do
    echo ${lines[$i]}
done

```

And, i got all of file name (with date time) like this in terminal. it looks completly:

```
Wed Dec 30 16:47:41 PHT 2015
Wed Dec 30 16:00:35 PHT 2015
Thu Dec 31 12:14:13 PHT 2015
Thu Dec 31 12:19:34 PHT 2015
Wed Dec 30 16:49:14 PHT 2015
Thu Dec 31 13:01:11 PHT 2015
Mon Dec 28 12:35:44 PHT 2015
...

```

But, i'm not sure how can i compare those many `string` as i use `date`.

And absolutely I'm not sure it's a really and complate way to revert the file whichs string like `Wed Dec 30 16:49:14 PHT 2015` to `Wed_Dec_30_16:49:14_PHT_2015.zip`

Thanks for help.

**Edit:**

I fix my script, and i comvert 'string' to 'date' which is seconds level:

```
declare -a my_array
len=${#lines[@]}
for ((i=0;i<$len;i++));do
    my_array[$i]=`date -d "${lines[$i]}" +%s`
done

```

and choose the max one:

```
max=${my_array[0]}
for((i=0;i<$len;i++));do
    if [ ${my_array[$i]} -gt $max ];then max=${my_array[$i]};fi
done
echo $max

```

terminal:

```
1451465261
1451462435
1451535253
1451535574
1451465354
1451538071
1451277344
1451538071 <== max one

```

So, should i revert it like: `Wed_Dec_30_16:00:41_PHT_2015.zip`?

Does anyone have a simple way?