Server version: Apache/2.4.10 (Debian)
This seems like it should be simple but manual pages and searching have not shown me an answer yet. Reduced it to as simple as I can, I don't understand why the date format is different in each.
#!/usr/bin/perl
use strict;
print "content-type: text/html\n\n";
print `who`;
When I call it up in a web browser I get
rob pts/1 Jul 1 12:28 (192.x.x.x)
The same script on a command line via ssh I get:
prompt$ perl tryme.cgi
content-type: text/html
rob pts/1 2016-07-01 12:28 (192.x.x.x)