If all that is needed is to see the output in an easy to read format you can use this:
mysql nms2 -t -e "select *, from_unixtime(dev_discovered) as 'First Discovered', modified as 'Last Modified' from devices" > D:\DeviceDiscoverDate.txt
or if you don't want all the info for each device
mysql nsm2 -t -e "select from_unixtime(dev_discovered), dev_alias, dev_name from devices" > DeviceDiscoverDate.txt
In this case dev_discovered = the 'First Discovered' in the first query.